Update query with query name (1 Viewer)

trab

Registered User.
Local time
Today, 20:09
Joined
Feb 10, 2014
Messages
19
I have table which I add records to on a monthly basis. I then populate fields using a succession of update queries. I would like to update a field, which tells me which update query was used to update that record. Is that possible without simply using free-text?

KR

Trav
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:09
Joined
May 7, 2009
Messages
19,169
i think no possible, you have to hard-code the query name.
 

Ranman256

Well-known member
Local time
Today, 16:09
Joined
Apr 9, 2015
Messages
4,339
cant you add the name into the query?

qry.png
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 16:09
Joined
Feb 19, 2002
Messages
42,973
Most of my tables include ChangeDT and ChangeBy columns. They are normally populated in the BeforeUpdate event of the form used to update that particular table. When I run bulk update queries, I do what Ranman256 suggested and populate both the date/time and I use the query name as the ChangeBy.
 

trab

Registered User.
Local time
Today, 20:09
Joined
Feb 10, 2014
Messages
19
Thankyou all. Not the answer I was hoping for, though - I wondered whether access would have some trick up its sleeve, maybe somewhere in the Build option. I have over 40 update queries, and I didn't relish having to edit them all. In the end, I went along with the VBA route using a variable for the query name.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:09
Joined
May 7, 2009
Messages
19,169
hello trab:


i am wrong, it can be done using query:


Update yourTable Set [nameOfQueryField]=[CurrentObjeName]
 

Users who are viewing this thread

Top Bottom