Searching Multiple Fields

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

Guest

I am looking to have a table with 12 fields and I want to be able to use a
form to search 1, 2, or any of the fields based on information provided from
users. So if I only put data in one field and btnclick to run a query I need
it to search in that field and give data back...

This gives me now records, any thoughts so far?

IIf(([Forms]![frmFind_Records]![Field1] Is Null),Like "*",Like
[Forms]![frmFind_Records]![Field1] & "*")

Thanks
 
This doesn't work either. If I left all the fields blank, I need it to
return all records, but if I put criteria in one or more I want it to only
return those records that contain the criteria...

Thanks for the try Steve?

Steve Schapel said:
Steven,

Try it like this...
Like Nz([Forms]![frmFind_Records]![Field1],"*")

--
Steve Schapel, Microsoft Access MVP

I am looking to have a table with 12 fields and I want to be able to use a
form to search 1, 2, or any of the fields based on information provided from
users. So if I only put data in one field and btnclick to run a query I need
it to search in that field and give data back...

This gives me now records, any thoughts so far?

IIf(([Forms]![frmFind_Records]![Field1] Is Null),Like "*",Like
[Forms]![frmFind_Records]![Field1] & "*")

Thanks
 
Steven,

We must be missing each other's meaning here! What I suggested,
extrapolated across your 12 fields, should do exactly what you are
asking. But anyway, you have obviously tried it, whatever "doesn't
work" might mean. Could you give us a bit more detail of what you are
doing, maybe with some specific examples, and someone will be able to help.
 
Back
Top