Saving Login Id on each record

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an access database using vba with sql tables. I want to add a field
that will automatically update with the userid of the person entering the
record. Any suggestions on code and how to retrieve login name.
 
an easy and quick way..... on the "Before Insert" event of the FORM
Me.CREATE_TS = Now()
Me.CREATE_ID = UCase(Environ("USERNAME"))

Of course CREATE_TS and CREATE_ID are fields in the table. I also have A
UPDATE_TS AND UPDATE_ID on the tables which are updated on the "Before
Update" Event of the Form.
 
I always recommend very strongly against using the Environment variable.
It's trivial to reset Environment variables. Go the API route.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top