6 replies
by bill_h
Your example code asks for the Find to look for a value equal to the string "textbox.Text", which does not exist. If you want the Find to look for the text *value* of a text box, use the following syntax:
Me.adoLogin.Recordset.Find "UserId='" & textbox.Text & "'"
This submits the value/text of the textbox, enclosed in single quotes. This syntax can also be used with string variables.
To use a numeric value, the following syntax will work:
Me.adoLogin.Recordset.Find "UserId=" & Val(textbox.Text)
There is no need to enclose a numeric value in single quotes; this syntax can also be used with numeric variables.
Hope this helps...
by bill_h
In reviewing my answer, the text displayed on my browser doesn't clearly show the single quotes I included in the example syntax. Let me clarify:
The statement "UserId='" & textbox.Text & "'" contains a *single quote* after the equal sign (=); the double-quoted string at the end is actually a double quote, a single quote and a double quote.
If you cut and paste the code I provided, you be able to see the correct syntax...
by dennisbv
by donq
by dennisbv
by dennisbv
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending