A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Append query with username and date



 
 
Thread Tools Display Modes
  #1  
Old February 23rd, 2010, 12:04 PM posted to microsoft.public.access.queries
dan
external usenet poster
 
Posts: 1,408
Default Append query with username and date

I am using an append query to add a new line to my table - one of the field
in this table is "Update_Date" and one is "Updated_By".
How via this query I can populated those two fields with the current
date&Time and current username of the user .
Many thanks,
Dan
  #2  
Old February 23rd, 2010, 12:49 PM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Append query with username and date

In query design view, type this into a fresh column in the Field row:
Now()
Below that indicate the field you want this value assigned to.

Do a similar thing with:
CurrentUser()
for the other field.

Note that CurrentUser() always returns "Admin" if the database is unsecured.
If you wanted the Windows user, use the GetNetworkUserName() function from
he
http://allenbrowne.com/ser-53code.ht...etworkUserName

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Dan" wrote in message
...
I am using an append query to add a new line to my table - one of the
field
in this table is "Update_Date" and one is "Updated_By".
How via this query I can populated those two fields with the current
date&Time and current username of the user .
Many thanks,
Dan


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.