Hi Graham,
Quick question for you. I'm using Allen's code to lock/unlock my form but
I'm setting it up to do it based on whether the "txtDateClosed" field is
null
or not. I put this code into my OnCurrent event so it will lock records
that
have a date closed and unlock records that do not.
Dim bLock As Boolean
If IsNull([txtDateClosed]) Then
bLock = IIf(Me.cmdUnlock.Caption = "&Lock", True, False)
Call LockBoundControls(Me, bLock)
Else
Call LockBoundControls([Form], True)
End If
But the problem is I'm getting an error everytime I open the form.
Error 2455 - You entered an expression that has an invalid reference to
the
property Form/Report
When I remove this portion of the above code I no longer get the error
message but it locks all the records even if the "txtDateClosed" is null
bLock = IIf(Me.cmdUnlock.Caption = "&Lock", True, False)
Call LockBoundControls(Me, bLock)
The "bLock" is referring to the command button on my form that I added per
his instructions. Could that be where the problem is?
SS
Graham Mandeno said:
Hi SS
Unfortunately you will need to lock all the controls individually
*except*
the one you want to edit. Allen Browne has some nice code for doing that
here:
http://allenbrowne.com/ser-56.html
--
Good Luck
Graham Mandeno [Access MVP]
Auckland, New Zealand
Secret Squirrel said:
I have a control on my form called txtDateClosed. When this is filled it
triggers the form to not allow edits to that particular record. How can
I
keep this the way it is but allow edits to one control on my form
header?
I
have a control on my form header I use to search for a particular
record.
I
want to be able to use this control even if the record I'm on is
locked.