Pull user's Usernames from their login screens

Z

zufie

My boss wants me to pull the user's Usernames from their login screens
and when a user adds or edits a record that the user's Username will
be pulled from the login screen and recorded with the record in the
Tbl Main ID.

Any ideas how to do this?

Thanks,

John
 
Z

zufie

My boss wants me to pull the user's Usernames from their login screens
and when a user adds or edits a record that the user's Username will
be pulled from the login screen and recorded with the record in the
Tbl Main ID.

Any ideas how to do this?

Thanks,

John

When I mention pulling the user's Usernames from their login screens I
meant pulling from the login screen where our user's login to the
Novell NAL launcher/our network at the beginning of the day.
 
Z

zufie

See whether the code inhttp://www.mvps.org/access/api/api0008.htmat "The
Access Web" gives you what you're after.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)







- Show quoted text -

Thanks.

The users are using the security database to log in, (that is, using
ms-access security) so I want to use the id (Username) that they log
in with for tracking.

Here is the code, someone sent me, that they use:

Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!ROWLASTCHANGE = Now()
End Sub

I believe I must add a field names USERNAME to my Tbl Main ID to where
the values for USERNAME would be held??

I believe I must also replace ROWLASTCHANGE (in code above) with the
field name, Date Last Updated, that I already have in my Tbl Main ID??

Based on the field names I mentioned I changed the code to the
following:

Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!Date!Last!Updated = Now()
End Sub

But the line, Me!Date!Last!Updated = Now(), gives me a Run-time error
2465 Microsoft Office Access can't find the field 'Date' referred to
in your expression. How then, must I type my field name, Date Last
Updated in the code for the code to be correct??

P.S. I think the USERNAME portion of the code is working correctly,
it's just the ROWLASTCHANGE portion (Date Last Updated) that is not.

Thank you!!!

Zufie (John)
 
D

Douglas J. Steele

Most of us consider spaces in field names to be a bad idea, but if you're
determined to keep them, try

Me![Date Last Updated] = Now()

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


zufie said:
- Show quoted text -

Thanks.

The users are using the security database to log in, (that is, using
ms-access security) so I want to use the id (Username) that they log
in with for tracking.

Here is the code, someone sent me, that they use:

Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!ROWLASTCHANGE = Now()
End Sub

I believe I must add a field names USERNAME to my Tbl Main ID to where
the values for USERNAME would be held??

I believe I must also replace ROWLASTCHANGE (in code above) with the
field name, Date Last Updated, that I already have in my Tbl Main ID??

Based on the field names I mentioned I changed the code to the
following:

Private Sub Form_Dirty(Cancel As Integer)
Me!USERNAME = CurrentUser()
Me!Date!Last!Updated = Now()
End Sub

But the line, Me!Date!Last!Updated = Now(), gives me a Run-time error
2465 Microsoft Office Access can't find the field 'Date' referred to
in your expression. How then, must I type my field name, Date Last
Updated in the code for the code to be correct??

P.S. I think the USERNAME portion of the code is working correctly,
it's just the ROWLASTCHANGE portion (Date Last Updated) that is not.

Thank you!!!

Zufie (John)
 

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

Top