Updated Date and Updated by User (1 Viewer)

muralikreddy

Kris Reddy
Local time
Today, 07:01
Joined
May 23, 2005
Messages
9
Hi,

I have to upload an excel file on a daily basis into a access table. I have created a macro for the same in access. But I want to add two fields to the the table everytime the data is uploaded to the table which are "Updated date" and "User". Please help me how can I update the two fields in the table.
 

ArtMiles

Art
Local time
Yesterday, 20:31
Joined
Dec 25, 2008
Messages
23
Hi,

I have to upload an excel file on a daily basis into a access table. I have created a macro for the same in access. But I want to add two fields to the the table everytime the data is uploaded to the table which are "Updated date" and "User". Please help me how can I update the two fields in the table.




Just run an update query for the 2 fields. Run it in the same macro.

Hope this helps.
 

muralikreddy

Kris Reddy
Local time
Today, 07:01
Joined
May 23, 2005
Messages
9
Thanks a lot for the response.

Its working but there is a small problem. Whenever i run the update query, the date for the entire table is getting changed. As I'm uploading the excel data into the table on a daily basis, actually the 'Uploaded Date' should be changed only for the current upload and not records previously uploaded.

Thanks & Regards,
 

ArtMiles

Art
Local time
Yesterday, 20:31
Joined
Dec 25, 2008
Messages
23
Hello,

Use the 'Criteria:' row of the update query to filter only the records you would like to update. One possiblity would be to add '>Date()' fo the date field.

Hope this helps

Art ;)
 

raskew

AWF VIP
Local time
Yesterday, 20:31
Joined
Jun 2, 2001
Messages
2,734
If you are adding new data to an existing table, you need to be using an Append Query rather than an Update Query, which would be used to modify existing data.

HTH - Bob
 

Users who are viewing this thread

Top Bottom