prevent users changing information after entry

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to restrict users from changing a key field in a record after they
have added it but none of the form events seem to allow this without
preventing them adding further records.

This seems like a regular requirement but i can't find anything about it
anywaher.... any help would be greatly appreciated!
 
Lorna said:
I need to restrict users from changing a key field in a record after they
have added it but none of the form events seem to allow this without
preventing them adding further records.

This seems like a regular requirement but i can't find anything about it
anywaher.... any help would be greatly appreciated!

Test for null in this field in the form's current event and set the
properties of the text box accordingly.

If IsNull(Me.txtMyTextBox) Then
Me.txtMyTextBox.Locked = False
Else
Me.txtMyTextBox.Locked = True
End If

HTH - Keith.
www.keithwilby.com
 
Keith

Thanks.... i had the code but was putting in against the field rather than
the form event.

Thanks again - very helpful and prompt!

Lorna
 
Lorna said:
Keith

Thanks.... i had the code but was putting in against the field rather than
the form event.

Thanks again - very helpful and prompt!

Lorna

You're welcome, glad to help.

Keith.
 
One other thought - it is relatively unusual to need to allow users to
touch key fields. It is (IMHO) preferable to use autonumber key fields
that the users don't have access to. Other fields can be indexed with
no duplicates allowed, it that is what you want, but key fields should
be protected from interference.

I need to restrict users from changing a key field in a record after they
have added it but none of the form events seem to allow this without
preventing them adding further records.

This seems like a regular requirement but i can't find anything about it
anywaher.... any help would be greatly appreciated!

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Lorna

This response my be way too late for your purposes but I just came across
your post while looking for something else.

I encountered a similar problem and posted a question on this form. The
answers I got may assist you. The post was headed 'Coding MsgBox Responses'

Kind regards

Tony
 
Back
Top