Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

safeguarding against unwanted edits in forms 1

Status
Not open for further replies.

katherine25

Technical User
May 17, 2001
4
US
Does anyone know the simplest way that I can safeguard against accidental edits on a form? I want a msg box to pop up and say- you have changed the data for various individual fields and ask the user if they are sure that they want to do this. If it is an accident and the user hits no- they did not want changes made- the old data should be restored.

thanks so much in advance
 
Why not make an "Edit" button and toggle the "AllowEdits" property to True/False for that form?

Gary
gwinn7
 
thanks so much. But i am still confused. I understand how to use 'allow edits' for an entire form but I am not sure how to apply this function to individual fields. any advice is appreciated.
 
Katherine:

In the form's On_Open event, set the locked property to True for all fields where you do not want the user to make changes.

In the Edit button's On_Click event change the locked property to False.

You should also add the locking routine to the form's On_Current event so that the fields are relocked when the user moves from record to record.

I generally use this procedure to lock all controls on the form except selection combos and navigation buttons. I put an Edit button on the form to unlock the controls and a Save button to explicity save the changes (I also include an Undo button to allow the use to cancel changes).

When the Edit button is clicked, I also disable all command and navigation buttons (except Save and Undo) until either the Save or Undo button is clicked.

This may be overkill, but I get paranoid about users messing with the data when they really don't intend to make changes.

Hope this helps.
Larry De Laruelle
larry1de@yahoo.com

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top