T
TinaR
I'm using Access 2007. I've read various posts on capturing the userid. I
have a form where the user is supposed to enter their name so we know who
created a particular record. (I'm interested in who created the record, not
if anyone modified it afterwards). Needless to say, they don't always
complete this field. I'd like to capture it automatically based on their
Outlook login.
I created a new module for the fOSUserName function I found on one of the
postings on this forum. I named the module basUserName.
Then I created a text field called UserID on my table and put the field on
my form.
In the Form's BeforeUpdate event I typed:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.UserID = fOSUserName()
End Sub
But when I create a new record and look at the UserID field on my form,
there's no data in it. If I understood the postings correctly, it should
have my login. What am I doing wrong?
Thanks!
Tina
have a form where the user is supposed to enter their name so we know who
created a particular record. (I'm interested in who created the record, not
if anyone modified it afterwards). Needless to say, they don't always
complete this field. I'd like to capture it automatically based on their
Outlook login.
I created a new module for the fOSUserName function I found on one of the
postings on this forum. I named the module basUserName.
Then I created a text field called UserID on my table and put the field on
my form.
In the Form's BeforeUpdate event I typed:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Me.UserID = fOSUserName()
End Sub
But when I create a new record and look at the UserID field on my form,
there's no data in it. If I understood the postings correctly, it should
have my login. What am I doing wrong?
Thanks!
Tina