B
BobRoyAce
I have two text boxes on a form where a user can enter a Username and
Password. Once they click on a button, I want to do a query against a Users
table to see if the login exists. I construct the SQL as follows:
Dim sSQL as string
sSQL = "SELECT UserID FROM Users " & _
"WHERE (UserName = """ & Trim$(txtUsername.Text) & """)" & _
"AND (UserPassword = """ & Trim$(txtPassword.Text) & """)"
When the line assigning to sSQL is run, I get an error message that states:
"You can't reference a property or method for a control unless the control
has the focus."
Why does this not work and how do I get around it?
Password. Once they click on a button, I want to do a query against a Users
table to see if the login exists. I construct the SQL as follows:
Dim sSQL as string
sSQL = "SELECT UserID FROM Users " & _
"WHERE (UserName = """ & Trim$(txtUsername.Text) & """)" & _
"AND (UserPassword = """ & Trim$(txtPassword.Text) & """)"
When the line assigning to sSQL is run, I get an error message that states:
"You can't reference a property or method for a control unless the control
has the focus."
Why does this not work and how do I get around it?