Hi Gang,
It seems like no matter how many times I try to set one of these up, I can't get it right.
rstLegacy.FindFirst "[IN-SSN] = '" & strSSN & "'" And _
"[IN-BENEFIT-CD] = '" & strBenefitCode & "'"
IN-SSN and IN-BENEFIT-CD are text-type fields.
Any and all assistance is greatly appreciated.
Bill K.
Search statement setup
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Search statement setup
You have placed the keyword And outside the quotes. It should be part of the search string, however:
rstLegacy.FindFirst "[IN-SSN] = '" & strSSN & "' And " & _
"[IN-BENEFIT-CD] = '" & strBenefitCode & "'"
rstLegacy.FindFirst "[IN-SSN] = '" & strSSN & "' And " & _
"[IN-BENEFIT-CD] = '" & strBenefitCode & "'"
Best wishes,
Hans
Hans
-
- Her Majesty
- Posts: 499
- Joined: 19 Jan 2010, 07:13
Re: Search statement setup
You seem to have some extra quotes in your statement and a missing ampersand. Try this:aardvark wrote:rstLegacy.FindFirst "[IN-SSN] = '" & strSSN & "'" And _
"[IN-BENEFIT-CD] = '" & strBenefitCode & "'"
Code: Select all
rstLegacy.FindFirst "[IN-SSN] = '" & strSSN & "' And " _
& "[IN-BENEFIT-CD] = '" & strBenefitCode & "'"
Charlotte
-
- Lounger
- Posts: 47
- Joined: 09 Feb 2010, 11:30
- Location: OH USA
Re: Search statement setup
Thank you Charlotte and Hans. I'm back in business. Have a nice weekend.
Bill K.
Bill K.