Locking Entries

S

Sok Hong

Is there a way to code so that you only lock only
specified functions? I've tried

Private Sub Form_Current()
Dim bAllow As Boolean

bAllow = Me.NewRecord
Me.[SomeControl].Locked = bAllow
Me.[AnotherControl].Locked = bAllow
...
End Sub

however, this will only allow me to lock it when I am on
that particular entry. Once I go to a different entry and
refer back to it, the entry will be unlocked.
Anythoughts? Thanks.
..
 
J

John Vinson

Is there a way to code so that you only lock only
specified functions? I've tried

Private Sub Form_Current()
Dim bAllow As Boolean

bAllow = Me.NewRecord
Me.[SomeControl].Locked = bAllow
Me.[AnotherControl].Locked = bAllow
...
End Sub

however, this will only allow me to lock it when I am on
that particular entry. Once I go to a different entry and
refer back to it, the entry will be unlocked.
Anythoughts? Thanks.

Bear in mind that the Form *is just a window*. You're locking
*controls on a form*, not locking *records in a table*.

In fact row-level locking is not at all easy in Access. Could you
describe just what you're trying to accomplish? How do you decide what
records should be locked and which shouldn't?
 
Top