Re: Arguement Not Optional?
Code:
MsgBox ("You have entered the wrong username and password")
->
MsgBox "You have entered the wrong username and password"
Re: Arguement Not Optional?
Still the same error, it's highlighting the if statement when it appears...
Re: Arguement Not Optional?
Is this VB6 or .Net?
If .Net, use txtPassword.Text and txtUserName.Text; I've read that you must provide the property names but am unsure
If VB6, ensure you do not have any control names, function/sub names or form names that use the name Password or UserName.
Re: Arguement Not Optional?
Quote:
Originally Posted by
LaVolpe
Is this VB6 or .Net?
If .Net, use txtPassword.Text and txtUserName.Text; I've read that you must provide the property names but am unsure
If VB6, ensure you do not have any control names, function/sub names or form names that use the name Password or UserName.
It's VB5 :lol: But still, it's not the problem with same names and .Text really does't work..
Re: Arguement Not Optional?
I think you may have a naming issue or indexing issue as I mentioned. If you dont' find an answer, you may want to zip up your form or project so we can take a look.
Re: Arguement Not Optional?
If its not the MsgBox than it is this, but you should change the messagebox call like i mentioned
Code:
If Username = txtUsername.Text And Password = txtPassword.Text Then
Re: Arguement Not Optional?
Btw, your code works for me, im using VB6
1 Attachment(s)
Re: Arguement Not Optional?
Think this zip has everything needed..
Re: Arguement Not Optional?
txtUserName and txtPassword are indexed. Their Index property is not blank, it has a number there. So, you must include the index with the control name, i.e.,
txtUserName(0).Text and txtPassword(1).Text.
Optionally, change the Index properties, from the property sheet, for those textboxes to be blank.
Re: Arguement Not Optional?
Quote:
Originally Posted by
LaVolpe
txtUserName and txtPassword are indexed. Their Index property is not blank, it has a number there. So, you must include the index with the control name, i.e.,
txtUserName(0).Text and txtPassword(1).Text.
Optionally, change the Index properties, from the property sheet, for those textboxes to be blank.
Awesome, it's stopped the error.. Just wont do anything when i click the button now?
Re: Arguement Not Optional?
No worries, ignore that last post.. Was just naming problems that i was messing with..
Thanks Guys, Big Help :D
Re: Arguement Not Optional?
You need to help us understand better? What exactly do you mean, "won't do anything". The button will either show a message box or display your frmLoginSuccess form, if it exists.
You didn't rename your command button did you? It is still named cmdLogin?
Edited: Cool, you figured it out. Please mark this post as resolved if it is resolved now.
Re: Arguement Not Optional?
Quote:
Originally Posted by
PGTibs
No worries, ignore that last post.. Was just naming problems that i was messing with..
Thanks Guys, Big Help :D
;);)