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

Update Information by using Command Button

Status
Not open for further replies.

Ajwebb

MIS
Jul 31, 2003
153
GB
Hi All,

Am not sure if what i am after is possible, but here goes.

I have a form with a command button which runs a query. In the table whichi is the data source for the query i have a field called ExportDate. I was wondering if it is possible that when i click my command button to run the query, it would fill in the ExportDate field for every record in the table with the current date?

Thanks for any help everyone

Anthony
 
sure, just add this code to the command button.

DoCmd.RunSQL "UPDATE Log SET TableName.[ExportDate] = Date();"
 
Thanks drctx,

However i added that code to my command button and came up with the error:-

Run-time Error '3078'

The Microsoft Jet Database Engine cannot find the input table or query 'Log'. Make sure it exists and that its name is spelled correctly.

Any ideas

Regards

Anthony
 
in the code change the 2 references to TableName in the code to your table names.

DoCmd.RunSQL "UPDATE TableName SET TableName.[ExportDate] = Date
();"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top