Hi all.
I am trying to code a user/password routine. So far I have the variables uName and uPassword defined as public strings.
in my workbook_open event, I have :
which does what I'd expect it to. The login window appears and the user name is prepopulated from application.username
once the user has entered a password, they click the Log In button.
I have :
I've commented out the call to the other (public) procedure as it doesn't work anyway. On the HIDE event, the control returns to the workbook_open event and it continues running the code to determine the user's access level. But it doesn't pass back the values for uName and uPassword from the loginwindow userform..?
Anyone know what I'm missing? I tried to create a property to be used publicly, but it was a bit beyond me, and vba's help is less use than my own guesswork.
Thanks
David
[joinedupwriting]
"whaddaya mean, 'invalid tag'?!?"
[/joinedupwriting]
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)
I am trying to code a user/password routine. So far I have the variables uName and uPassword defined as public strings.
in my workbook_open event, I have :
Code:
loginwindow.show
once the user has entered a password, they click the Log In button.
I have :
Code:
Public Sub Loginbutton_Click()
uPassword = Password.Value
If (uPassword = "") Then
passreq = MsgBox("Please enter your password", vbOKOnly)
Else
uName = UserName.Value
End If
'Call findaccess(uName, uPassword)
LoginWindow.Hide
End Sub
Anyone know what I'm missing? I tried to create a property to be used publicly, but it was a bit beyond me, and vba's help is less use than my own guesswork.
Thanks
David
[joinedupwriting]
"whaddaya mean, 'invalid tag'?!?"
[/joinedupwriting]
![[lightsaber] [lightsaber] [lightsaber]](/data/assets/smilies/lightsaber.gif)