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

Save data on form besides closing form

Status
Not open for further replies.

mikepf

Programmer
Sep 5, 2007
38
US
I can update a table (dates)in a form then click on a button to execute a query but the new dates in the table are NOT used with the query. If I close the form and re-enter, the dates are then used with the form. If I click the SAVE button the dates are NOT saved in the table to then be used with the query. I have gone into properties and tried to do a Save Table(macro) on Data Change but no good. This has to be something simple but I cannot quite see it.
 
Ginger,
I show a click event for the form but putting the line of code (I didn't change the code) in the click event didn't save the data before running the query. Any thoughts
 
Ginger,
This is what the code looks like.

Private Sub Form_Click()
DoCmd.RunCommand acCmdSaveRecord

End Sub
 
In your BUTTON'S OnClick event, not the Form's OnClick event. You said you have a button you click to run a query; put it in that button's code.

Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244. Basics at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top