Multiple parameters with QueryDef

  • Thread starter Thread starter Vince
  • Start date Start date
V

Vince

I am attempting to build a query based on 2 tables having
3 parameters using QueryDef. The user enters the
parameters via inputboxes. The query works if I use only
one of the parameters, but I can't figure out the correct
syntax for all 3. The 3 'Where' statements are listed
below and all will work if run by themselves.

Any help would be appreciated.

Thanks

Vince

"WHERE TblAttendance.week= " & strwk
"WHERE TblRA.wrkr= " & Chr(34) & strwrkr & Chr(34)
"WHERE TblRA.Br= " & Chr(34) & strbr & Chr(34)
 
Assuming they are inclusive, it would be

"WHERE TblAttendance.week= " & strwk & " AND TblRA.wrkr=
" & Chr(34) & strwrkr & Chr(34) & " AND TblRA.Br= " &
Chr(34) & strbr & Chr(34)

Hope This Helps
Gerald Stanley MCSD
 
Back
Top