Coding a Form Control Button

dsellers1

Registered User.
Local time
Today, 15:06
Joined
May 19, 2009
Messages
39
I am trying to create a button that, when clicked, will open up a separate Form based on the username from Windows. I already have the code for my username Module and am not concerned about that piece of it. I just can't figure out the coding for the Button so that when I click on it, it will take me to a different Form than if my co-worker clicks on it.

Not sure you would need it but here's some more info:
frmOne will need to be opened by Windows username asmith
frmTwo will need to be opened by Windows username bjones
etc.


Module Code

On Error Resume Next

Dim NBuffer As String
Dim Buffsize As Long
Dim Wok As Long

Buffsize = 256
NBuffer = Space$(Buffsize)


If UOrC = 1 Then
Wok = api_GetUserName(NBuffer, Buffsize)
atCNames = Trim$(NBuffer)
Else
Wok = api_GetComputerName(NBuffer, Buffsize)
atCNames = Trim$(NBuffer)
End If
 
Thanks John, I'll check it out
 

Users who are viewing this thread

Back
Top Bottom