G
Guest
I've found some code here that allows me to lock & unlock forms with a button
- that part works great, but I'd like to change the format of the fields so
it's obvious which state it's in. i.e., greyed-out for locked. Can I add
something to this code (from Allen Browne originally, thanks allen!) to do
that?
Private Sub cmdLock_Click()
Me.Refresh
Dim bAllow As Boolean
bAllow = Not Me.AllowEdits
Me.AllowEdits = bAllow
Me.AllowAdditions = bAllow
Me.AllowDeletions = bAllow
Me.cmdLock.Caption = IIf(bAllow, "&Lock", "Un&Lock")
End Sub
I'm new to VBA but I can paste & clip with the best of them. So far so good.
Thanks,
Seana
- that part works great, but I'd like to change the format of the fields so
it's obvious which state it's in. i.e., greyed-out for locked. Can I add
something to this code (from Allen Browne originally, thanks allen!) to do
that?
Private Sub cmdLock_Click()
Me.Refresh
Dim bAllow As Boolean
bAllow = Not Me.AllowEdits
Me.AllowEdits = bAllow
Me.AllowAdditions = bAllow
Me.AllowDeletions = bAllow
Me.cmdLock.Caption = IIf(bAllow, "&Lock", "Un&Lock")
End Sub
I'm new to VBA but I can paste & clip with the best of them. So far so good.
Thanks,
Seana