Lock data

J

judith

I have set a lock on the On Current property for my form

Me.Form.AllowEdits = true

' check for approved
If Me.approved > 0 Then
Me.Form.AllowEdits = False
End If

Unfortunately there is a combo, select record box on the form so I cant then
move to another record as this is locked too. There are too many fields to
lock them individually rather than the entire form. Any suggestions please.
 
T

Tom van Stiphout

On Wed, 28 Apr 2010 06:46:01 -0700, judith

You can loop over the Controls collection and not lock some controls
that should stay active:
dim ctl as control
for each ctl in me.controls
if me.name ="myFirstUnlockedControl" or
me.name="mySecondUnlockedControl" then
'do nothing
else
ctl.Locked = True
end if

-Tom.
Microsoft Access MVP
 

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