better password protection:
on ur project, click on Form1 or however its colled for u, chose Add, then Form, chose Log in Dialog. Doubleclick OK, here's where u set the password:
Code:
If txtPassword = "password" Then
just change the "password" to any string or combination of letters/numbers, so it can be like:
Code:
If txtPassword = "asd12a234" Then
password will be asd12a234
the username doesnt matter, can be left as empty blank.
thats the OK code:
Code:
Private Sub cmdOK_Click()
'check for correct password
If txtPassword = "asd" Then
'place code to here to pass the
'success to the calling sub
'setting a global var is the easiest
LoginSucceeded = True
Me.Hide
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
End Sub
After Me.Hide place YourFormName.Show.
on the right side of ur screen there's a tree listing, right click Project1 or however ur project is called, then do YourProjectName Properties... and at Startup Object choose frmLogin. U can simply delete the username textbox or code it so it will check for username too.
Attached example app with login