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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you save data on the fly in a bound form using code 1

Status
Not open for further replies.

sellert

Programmer
Nov 18, 2004
36
US
Greetings,
I have a form that checks to see if the record already exists when the Add button is pressed. If the recored is there it checks for required data. If there is missing required data, the system will display a message saying that the record was previously added but has missing data. It then says that it is updating the data. The system then updates the controls on the form for the missing required data based on data from a different system. I don't want to have to close the form or move to a different record to make it save. What is the command that I should use to save the data changes on the form into its bound table?
 
[tt]RunCommand acCmdSaveRecord[/tt]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
VBSlammer,
Once again you save the day. I knew it was something simple but couldn't find it in help or my existing documentation. Is there a good book out there you know of that will simply list the various commands in VBA, an explenation of what it does and show a simple example?

I looked first in help for Docmd, Save, Update and also in my Access 97 developers handbook but nothing seem to fit until you turned me on to RunCommand.

THANKS!!!!
 
Another way:
Me.Dirty = False

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I have Access For Dummies. It helped me learn the basics a lot, and even has a bit of the more Intermediate stuff in there. Depending on your skill level, you might wanna check it out.

-------------------------
Just call me Captain Awesome.
 
Actually, I learned it from trial and error. The CommandButton wizard still uses a deprecated method that involves mimicking the Save Record menu action.

If you create your own macro and set the action to RunCommand, you'll get a complete list of commands for it in plain english, in alphabetical order - all you have to do is prefix with "acCmd" in your code.

I usually use the Object Browser to find anything I'm looking for. You can even right-click it and select "Show Hidden Members" to expose objects/properties/events that are normally hidden. Select "Access" as the library to use, then in the search textbox type "Save" or "Record" and it will display the enumerated type for acCmdSaveRecord, which is AcCommand. So if you type AcCommand. while you're coding the intellisense will provide a list of constants available for the command.

I've always wondered why the Access Team decided not to include a macro recorder with Access like they did with Excel. [idea]

VBSlammer
redinvader3walking.gif

"You just have to know which screws to turn." - Professor Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top