jlocke
05-23-2003, 08:03 AM
Hello group, What i am trying to do is have a form with combo boxes where the user selects their own criteria and feed the query to get a custom report. I have so far manged to get only exact matches to work. but let's say perhaps i need to leave one field blank to retrieve all options, i get nothing at all..
dcx693
05-23-2003, 08:36 AM
The problem lies in your use of this expression:
[tbl OAR]![Disposition])=IIf([Forms]![frm User selection report form]![Disposition_cmb]=Null,"*",[Forms]![frm User selection report form]![Disposition_cmb])
As you've seen, it works fine if the user makes a selection. But if the user leaves the combo box empty, the expression evaluates to this:
[tbl OAR]![Disposition])="*"
This expression does a literal comparison between Disposition and *. That obviously doesn't work. What you need is something like [Disposition] Like "*", but you won't get it using the expression structure you have because you have the "=" operator in there.
I will work on the problem and see if I can come up with a quick fix. Otherwise hopefully someone else can post a solution.
Hayley Baxter
05-23-2003, 10:09 AM
I have a working sample that does exactly what you need unless I have misread what you are trying to do. It's too big to attach to the forum if you want it drop me an email.
Hayley Baxter
05-27-2003, 05:07 AM
I have received quite a few emails regarding this post, just thought to myself that I do have a smaller database that shows how this works that I've already posted on the forum.
Although Brian's problem in this post is different to this thread if you open up the search form and look at the query name Query_Dynamic_QBF this will show you the results being retrieved by the form. Have a look at the coding in the search form.
Download the db in this thread
http://www.access-programmers.co.uk/forums/showthread.php?threadid=46460
Hayley Baxter
05-28-2003, 05:15 AM
Hi Joe
I have been notified today that you have tried to send me an email, however my company appear to have blocked it for whatever reason so if you still need help send it to my other account or post back here.
HayleyBaxter716@hotmail.com