Followup to LogIn question

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

Guest

Once I have that module in, how do I get a field (User) on a form (linked to
a table of course) to update with the users login ID? Basically, I need the
User field to update every time a record is changed so we know who the last
person to change it was
 
I used a "hidden" screen containing a select case that assigns the user code
to a text box. This solution works if you have only a few users.


Dim Temp As String

' pUserName is the name of the text box in the form

'include yourself in the select case

Temp = fOSUserName()

Select Case UCase(Temp)
'------------------
Case "USER 1"
pUserName = "USER CODE 1"
'------------------
Case "USER 2"
pUserName = "USER CODE 2"
'------------------
Case "USER N"
pUserName = "USER CODE N"
'------------------
Case Else
MsgBox vbCrLf & vbCrLf & _
" ****** You are NOT authorized to access this file ******" &
vbCrLf & vbCrLf & _
" This application will terminate NOW..." & vbCrLf &
vbCrLf & _
"===================================", 0, " ******
UNAUTHORIZED USER *******"
Application.Quit
'------------------
End Select
 

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

Similar Threads

Access Login 3
Login capture 4
Database Login details 2
Locked Records 2
Login Problem 1
User login 5
How to change the login user name in Access Project (adp) 1
Users in login 3

Back
Top