Creating custom report by form selection

jlocke

Registered User.
Local time
Today, 00:29
Joined
Jul 23, 2002
Messages
31
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..
 

Attachments

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.
 
Last edited:
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.
 
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
 
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
 

Users who are viewing this thread

Back
Top Bottom