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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO Recordset Manipulation 1

Status
Not open for further replies.

smithph

Technical User
Oct 27, 2000
57
GB
Hi, All,
Can anyone please tell me what the correct syntax is for using Filter to find a particular record with two variables to filter on?
For example, I am using this :-
addfile.Filter = "Password = '" & str1 & "'" And "UserName = '" & str & "'"
to find if a particular password and a particular username occur as a record in an opened recordset. The recordset seems to open OK,it has fields called Password and UserName and if I use either one of the variable statements on their own eg :-
addfile.Filter = "Password = '" & str1 & "'"
this works OK. When I put them both together it fails!!
Thanks in advance
 
TRY THIS

addfile.Filter = "Password = '" & str1 & "' And UserName = '" & str & "'"

I left out the double quotes ^ ^
the AND word needs to be inside the string. DougP, MCP
dposton@universal1.com

Ask me how Bar-codes can help you be more productive.
Or visit my WEB site
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top