Edit Record Button?

Tangent

Always going off on one!
Local time
Today, 22:19
Joined
Apr 3, 2010
Messages
19
I have the beta version of Access 2010 and have created a form for one of my tables and set allow edit and allow delete to No so that I can't easily accidentally alter any of the info in the table.

I used the Command Button Wizard to create Add Record and Save Record and Delete Record buttons for the form which are all working well.

My problem is that there is no 'Edit Record' in the wizard and there will be times I need to edit the data. I have an Edit Record button in my Address Book I built years ago but am not sure how to create one for my new database.

I searched online and tried entering Me.EditRecord=True in the Onclick event but this didn't work. Any help will be very much appreciated.
 
Try me.AllowEdits=true

One way to find out the name of such commands if to click on the relevant property in the property window and press F1 for help.

Another way to find out more commands is when you type in the VBA window an type the me. you should see a list of possible options pop up. If you select an option then click on it and press F1 then you'll see the help for that command.

Chris
 
It is asking me that if "me" is a macro that I must make sure I have saved it
 
Where are you typeing the code? It needs to be typed in the VBA window.

When I add a new button I do this:
- add the button
- cancel the wizard
- rename the button to something appropriate
- click on the three dots at the far right of the On Click event (in properties) and select Code Builder.

This will open the VBA window with a blank subroutine for you to type whatever you want. This is where you type me.AllowEdits=true

Hth
Chris
 
Thanks Stopher, it seems to be working now but once I've edited a record it remains editable. I put in a Save Record button using the wizard but this still leaves the record editable and so open to corruption by mistake.

Is there any way that I can return the form to AllowEdits=No after changing it?
 

Users who are viewing this thread

Back
Top Bottom