Multiple Parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I know I've seen the answer to this, but after much searching, I can't find
it again. I have a parameter query that has 8 parameters that it gets from a
form. When I try to add a new field with a parameter, it doesn't acknowledge
its existance. I'm hoping that I can use VB for the query instead. Is there
an example out there I can use for guidance. I'm a super novice at VB, so
one with lots of explaination text would be great.
Thanks!
Melinda
 
strW = ""


'Extract data from a form
with controlname
if len(.value) > 0 then
if len(strW) > 0 then strW = strW & " AND " 'inline if statment. no
endif
'User has entered a value in this control
strW = strW & " [Fieldname] = " & .value
end if
end with

'Create the inline SQL statement with or without a WHERE clause
strSQL = "Select * from tablename"
if len strW > 0 then
strSQL = strSQL & " WHERE " & strW
end if
 
Back
Top