Edit Records Command

oskar

Registered User.
Local time
Today, 04:28
Joined
Jul 9, 2013
Messages
69
I’m adding some command buttons to my Contacts manager Form in Access 2010 but noticed there are pre-configured commands for Add / Delete / Save records but non for Editing a record.

I don’t know very much about programming but wonder is it easy to add a command button to Edit a record and how?
 
You don't really need one. As soon as you start typing on any control, the record is being edited and you'll notice a pencil icon on the top left hand side when this happens.
 
Good to know, thank you
 
Fyi: If you really want a physical button then you do this:

Code:
Me.txtBoxName.SetFocus
Me.Dirty = True
...i.e. set focus to any control that is enabled, and set the dirty property of the form to True.
 
As I said I dont know very much coding but "Me.Dirty=True" sound funny lol, but will give it a try, thanks
 
I think it should be You.Dirty=True :D

The only scenario where an Edit button is necessary is when the form is locked, otherwise there's no need.

You put the code I gave you in the Click Event of the button.
So go to the Events tab on the button's Property Sheet > look for On Click > click the ellipsis (...) button > select Event Procedure > paste the code there and amend the textbox name.
 

Users who are viewing this thread

Back
Top Bottom