PDA

View Full Version : Can I create a command button that allows users to edit records on a form?



wedd
09-21-2011, 07:35 AM
Hi experts, I am a novice, and I would like to be able to edit records on a form with a click command in access 2010. I want to prevent any user from just typing within the text boxes on the form without clicking a command edit button first. Can this be done? If so, how can this be done? Would you have any sample code to attach to the editing button, to do this interesting problem.


Thanks for your contributions:friends:

hansup
09-21-2011, 09:38 AM
Hi experts, I am a novice, and I would like to be able to edit records on a form with a click command in access 2010. I want to prevent any user from just typing within the text boxes on the form without clicking a command edit button first. In your form's On Current event, set each text box's Enabled property to False and/or Locked to True. That will prevent the user from changing any of the text box values.

Then, in the click event of your "edit" command button, set those properties to Enabled = True and Locked = False. Those changes will allow the user to edit those text boxes bound to the current record. Once the user navigates to a different record, the On Current event will fire and make those text boxes uneditable again.


Would you have any sample code to attach to the editing button, to do this interesting problem No.