Unanswered: Can i put more than one parameter criteria in one query based search form?
I have a form with an unbound control linked to a query. So I can put an item name in the control and the query returns all records for that one item. For example, in the query criteria I have
'Like [forms]![formname]![itemname] & '*').
Is it possible to use the same underlying query to search my records via the item name or by date. For examples,
Date Criteria in query:
IIf(IsNull([forms]![formname]![itemname]), Then Like [forms]![formname]![datename],)
So if the item name isn't entered but the date is then search by date. If the item name is entered then do not search.
Item Criteria in query
IIf(IsNull([forms]![formname]![date]), Then Like [forms]![itemname]![datename],).
Is this possible? I've tried it but the returned search remains emtpy.
any advice would be great,
Remove the criteria from the query and use either a filter or criteria in VBA depending on what exactly you are trying to do (change the record set on the current form, gather criteria on a form and use it to open another form, gather criteria on a form and use it to open a report).
My VBA abilities are next to nothing!! I'm not sure I would know where to start.
What i would like is to have a form with two unbound controls on it, Date and Item. Below these are the fields from the query, so these return records 'Like' my unbound controls. So my unbound controls act like my search.
i didn't want to open up another form or report. If I enter a date it will return everything ordered on that date, or if i enter an item it will show me the item and when it was ordered.
does that make sense?
i wouldn't know how to make this work in VBA.