Navigation button

A

Alex Martinez

Hello,

In my form I locked all the fields in order that the user cannot delete or
change a record. I do have a command edit button that will unlock all the
fields so the user can update a record and when the user press the naviation
button to previous or next record all the fields will be locked. My problem
is when using the navigation button to add a record I am unable to add
anything to those fields. I don't know where to go so I can code to unlock
the fields and populate the m. Any tips or suggestions will be appreciated.
Thank you.
 
N

Nikos Yannacopoulos

Alex,

Use the form's Current event; in it, check the NewRecord property, and
run your locking/ unlocking code accordingly:

Private Sub Form_Current()
If Me.NewRecord Then
'code to unlock
Else
'code to lock
End If
End Sub

HTH,
Nikos
 

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