I have created a UserForm named Login_Pad with 2 UserBox's and 2 CommandButton's
The First UserBox user labeled "User" the second UserBox is labeled "Password".
The First CommandButton is labeled "OK" the second CommandButton is labeled "Cancel"
The idea here is to show this UserForm using "Login_Pad.Show" then have the user enter their User ID and password and press the CommandButton "OK".
At this point I want to search their user name on a worksheet called "Setup" cell's B3:B50 at that point confirm that the password entered equals the password in the adjacent cell C3:C50.
If these compare exit out of Login_Pad and allow the original script to continue.
If these do not compare exit out of Login_Pad and goto lastline of original script
I have tried different ways to accomplish this, the last way I thought of was to write the contents of the UserForm" onto the sheet "Setup" then do a basic compare their using the "=" sign. Unfortunatly I have been unsuccessful at getting the data to the spread sheet.
The Following is the script file from the UserForm Login_Pad.
-----------------------------------------------------------------------
Private Sub Canceled_Click()
Dim MyPassword
MyPassword = "Canceled"
Login_Pad.Hide
End Sub
--------------------------------
Private Sub OK_Click()
'Theese command lines did not check to see if password is correct.
' Dim MyPassword
' MyPassword = "Aproved"
Login_Pad.Hide
End Sub
---------------------------------
Private Sub User_Box_Change()
' Dim User
' User = "Aproved"
End Sub
----------------------------------
Private Sub Password_Box_Change()
' UserPassword = "Aproved"
End Sub
-----------------------------------
Private Sub UserForm_Click()
'Theese commands did not work here
'Sheets("Setup").Range("D33").Value = User.Text
'Sheets("Setup").Range("E33").Value = Password.Text
End Sub
-----------------------------------
Private Sub User_AfterUpdate()
'This commands did not work here
Sheets("Setup").Range("D33").Value = User.Text
End Sub
-----------------------------------
Private Sub Password_AfterUpdate()
'This commands did not work here
Sheets("Setup").Range("E33").Value = Password.Text
End Sub
I am somewhat of a novice on Excell but have some basic knowledge. Thank you all in advance for your thoughts and ideas.
The First UserBox user labeled "User" the second UserBox is labeled "Password".
The First CommandButton is labeled "OK" the second CommandButton is labeled "Cancel"
The idea here is to show this UserForm using "Login_Pad.Show" then have the user enter their User ID and password and press the CommandButton "OK".
At this point I want to search their user name on a worksheet called "Setup" cell's B3:B50 at that point confirm that the password entered equals the password in the adjacent cell C3:C50.
If these compare exit out of Login_Pad and allow the original script to continue.
If these do not compare exit out of Login_Pad and goto lastline of original script
I have tried different ways to accomplish this, the last way I thought of was to write the contents of the UserForm" onto the sheet "Setup" then do a basic compare their using the "=" sign. Unfortunatly I have been unsuccessful at getting the data to the spread sheet.
The Following is the script file from the UserForm Login_Pad.
-----------------------------------------------------------------------
Private Sub Canceled_Click()
Dim MyPassword
MyPassword = "Canceled"
Login_Pad.Hide
End Sub
--------------------------------
Private Sub OK_Click()
'Theese command lines did not check to see if password is correct.
' Dim MyPassword
' MyPassword = "Aproved"
Login_Pad.Hide
End Sub
---------------------------------
Private Sub User_Box_Change()
' Dim User
' User = "Aproved"
End Sub
----------------------------------
Private Sub Password_Box_Change()
' UserPassword = "Aproved"
End Sub
-----------------------------------
Private Sub UserForm_Click()
'Theese commands did not work here
'Sheets("Setup").Range("D33").Value = User.Text
'Sheets("Setup").Range("E33").Value = Password.Text
End Sub
-----------------------------------
Private Sub User_AfterUpdate()
'This commands did not work here
Sheets("Setup").Range("D33").Value = User.Text
End Sub
-----------------------------------
Private Sub Password_AfterUpdate()
'This commands did not work here
Sheets("Setup").Range("E33").Value = Password.Text
End Sub
I am somewhat of a novice on Excell but have some basic knowledge. Thank you all in advance for your thoughts and ideas.