How to Unlock

A

Asif Rehman

Hello

I have the following code in my form which currently locks
the orders form the next day. Is it possible to have a
button which will unlock the particular record and then
lock it again. Also is it possible to have a password so
when the button is pressed a password has to be entered to
unlock the record and then when the button is pressed
again for it to be locked.

The code is as follows
Private Sub LockCtls(blnLock As Boolean)

Me.ProductID.Locked = blnLock
Me.UnitPrice.Locked = blnLock
Me.Quantity.Locked = blnLock
Me.Discount.Locked = blnLock
Me.WeightOfProduct.Locked = blnLock

End Sub

Private Sub Form_Current()

Dim blnLockIt As Boolean

If Date > DateValue(Nz(Forms!Orders![OrderDate],
Date)) Then
blnLockIt = True
Else
blnLockIt = False
End If

LockCtls blnLockIt
End Sub

If it is possible how would I do it.

I hope you have understood my question and any help will
be much appreciated.

Kind Regards
Asif
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top