Locking fields on the same form!

Sohaila Taravati

Registered User.
Local time
Today, 04:40
Joined
Oct 24, 2001
Messages
266
I have a form that the user uses for add and edit. How can I use the same form when they are in the add mode they can add and do whatever, but when they are in edit mode some of the fields would be locked and wouldn't be able to change them. I hope I said it clear enough! thanks in advance
smile.gif


Soahila
 
Generally speaking if the record the user is working on is a new record then they are not in 'edit' mode. If the record they are working on is not a new record we can assume they are 'editing' the record. If that is your case then code similar to this in the On Current event of the form should get you started:

If Not Me.NewRecord Then
Me![Fieldx].Enabled = False
Me![Fieldy].Enabled = False
...etc...
Else
Me![Fieldx].Enabled = True
Me![Fieldy].Enabled = True
End If
 
Thanks jack,
That seems to work, I will give it a try.
Sohaila
 

Users who are viewing this thread

Back
Top Bottom