PDA

Click to See Complete Forum and Search --> : SQL in Access '97


ernmeister
Sep 12th, 2000, 04:19 PM
Ok, the following line will work as a SQL filter:


intBoxTotalMis = DSum("[mis]", "Used", "[BoxCode] = " & strQuote & strBoxCode & strQuote

However, the following line will not:

intBoxTotalMis = DSum("[mis]", "Used", "[BoxCode] = " & strQuote & strBoxCode & strQuote And "[LineCode] = " & strQuote & strFilterLine & strQuote)

When I try to run the program, it gets to this line and gives me a Run-time error '13' message stating "Type mismatch". Can anyone tell me the proper syntax to make it work?

Thanks,
ern

JHausmann
Sep 12th, 2000, 04:27 PM
perhaps this will be better:

intBoxTotalMis = DSum("[mis]", "Used", "[Boxcode] = " & strQuote & strBoxCode & strQuote & "And [Linecode] = " & strQuote & strFilterLine & strQuote)

ernmeister
Sep 12th, 2000, 04:34 PM
J,

Perhaps is right. That was the ticket. Thanks!!

ern