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

Date stamp in table for when record was last exported 1

Status
Not open for further replies.

fishtek

Technical User
Aug 21, 2002
56
US
I am pulling data from a table via a query to be exported to excel. I have created a field in the table to display a date when the record was last exported. How do I date stamp the field to show when I queried/exported the record? Any help would be appreciated.
Thank You
 
Since you want the output of a query and the TransferSpreadsheet function only exports tables, we'll simply base a MakeTable query on the query of choice, and create a table with only the dataset your query provides, and in the order provided.

It should be only a few steps on a macro to do what you want to do.
Echo Off
Open Query (the MakeTable Query)
TransferSpreadsheet (from the newly created table)
OpenTable (the table where your Timeinfo is to be stored
GotoControl Go to the field where you want to store the data. I suggest an expression here. DLookup("[Time]","
"."[Time] Is Null")

So it scoots down the Time field in order till it finds the first null record, and then, the last commands are

SetValue [Time] (or [Screen].[ActiveControl]), Time()
CloseTable

That should just about do it.
 
Thanks. Both suggestions were a huge help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top