jaytee716
06-03-2008, 09:02 AM
Ok, so I've been working on this for a couple weeks searching articles and attempting different modules and coding but have been stumped once again.
I have one main table called tTestScripts and added 2 columns, "Username" and "DateTime". When the user enters information in the form, on close I want to put their XP Username and date and time in the appropriate columns. I do not want to have a log in when the user enters Access. The farthest that I came to accomplishing this was making a text box in the form and for the control put in =osusername (or something like that, not sure) and it populated the field but I couldn't figure out how to get it to write back to the table. So I did more searching and found an advanced module (which I tried and tweaked but couldn't get to work). Then I found this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
' Log the user details to the table
Me!SystemUsername = User_FX
Me!RecordChanged = Now()
End sub
Which does not work either....and yes I changed this to fit my column names in my form, but maybe I didn't tell this code to put the information into my table.
All that I am trying to do is to update the table with the XP Username along with the date and time when the form is closed or loaded, or at this point anytime the user is in the form.
Can anybody help me and point me into the right direction?
You all have been a great help so far and appreciate everything everyone does here!
I have one main table called tTestScripts and added 2 columns, "Username" and "DateTime". When the user enters information in the form, on close I want to put their XP Username and date and time in the appropriate columns. I do not want to have a log in when the user enters Access. The farthest that I came to accomplishing this was making a text box in the form and for the control put in =osusername (or something like that, not sure) and it populated the field but I couldn't figure out how to get it to write back to the table. So I did more searching and found an advanced module (which I tried and tweaked but couldn't get to work). Then I found this:
Private Sub Form_BeforeUpdate(Cancel As Integer)
' Log the user details to the table
Me!SystemUsername = User_FX
Me!RecordChanged = Now()
End sub
Which does not work either....and yes I changed this to fit my column names in my form, but maybe I didn't tell this code to put the information into my table.
All that I am trying to do is to update the table with the XP Username along with the date and time when the form is closed or loaded, or at this point anytime the user is in the form.
Can anybody help me and point me into the right direction?
You all have been a great help so far and appreciate everything everyone does here!