Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password protection

Status
Not open for further replies.

robuk65

Programmer
Joined
Aug 17, 2001
Messages
2
Location
GB
Could anyone please help, i am very new to VB and I am having problems.

For night school we have to produce two forms the first of which needs a username and password which will take you to the next form via a command button.

I am totally lost as i am unable to make it work has anyone any suggestions.

Gratefully Rob
 
dont worry
its simple to create a username password form
click project menu->click Add form->
in that select Log in Dialog

on the "OK" button Click event

replace the codes with this
------------------
If txtPassword = "rob" And txtUserName = "rob" Then
LoginSucceeded = True
Me.Hide
newform.Show 'replace with ur second form name
Else
MsgBox "Invalid Password, try again!", , "Login"
txtPassword.SetFocus
SendKeys "{Home}+{End}"
End If
------------------

and then set startup object as "loginfrm" in ur project properties.thats all. run ur program it starts with username and password form.
enter username as rob
password as rob

if u want further help
mail to raghuram23@hotmail.com

with regards
webspy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top