record lock

  • Thread starter Thread starter RML
  • Start date Start date
R

RML

I would like to be able to set my records to lock and
then unlock them with a button when some criteria was
meet. I know the criteria but not sure about the code
for unlock.

Thanks.
 
RML said:
I would like to be able to set my records to lock and
then unlock them with a button when some criteria was
meet. I know the criteria but not sure about the code
for unlock.

My code won't work in continuous or datasheet subforms (it's aircode
anyway):

If Me.NewRecord = False

Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Or TypeOf ctl Is ComboBox Then
ctl.Locked = True ' or False to unlock
End If
Next ctl

End If
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Back
Top