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!

Update a Record from an open form 1

Status
Not open for further replies.

hceonetman

Technical User
Mar 16, 2001
92
US
In trying to eliminate several popups asking for report parameters, I created a one-record table containing the parameters. User selects the item ID from a combo box (bound to a second table) and then enters the other parameters on the rest of the form. A button at the bottom of the form causes the report to run but does not close the form, there is a separate exit button. The problem is when I run the report the underlying table has not been updated with the information entered on the form. What is the best way to cause the form fields to be written to the table? I have experimented with repaint and refresh but so far with no luck.

Thanks for your help,
HCEONETMAN
 
Take a look at the requery method. Also when you add or modify a record, you should use the update method, that way your table will reflect any additions or changes.
 
In the OnClick of the button that runs your report put this line of code in:

DoCmd.RunCommand acCmdSelectRecord

This will save the current record with the parameter data that the user has indicated on the formn.Make sure that this code is placed in front of the code that opens your report. I am assuming that the code for this process is in this same procedure.

Let me know if you need more assistance with this.

Bob Scriver
 
Bob,
Thanks, that was exactly what I needed. Report runs like a charm now.

HCEONETMAN
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top