Creating an form to print filtered reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KADANS
    New Member
    • Apr 2008
    • 1

    Creating an form to print filtered reports

    Hello,

    I'm an technical designer, trying to get information out of a database (access2003).

    Recently my company has installed an new drawingprogramm a, one which has links with a database. So when you design an equipment, you can assemble it with parts (predesigned drawings) with information connected to it. This information is gathered in a database. A datamanager gives us access to the information. Trough predefined qeury's we can get certain basic information, but thats not enough.

    We want 1 vieuw (form) on which we can select information (this with pulldown combo box's). For example: 1 form with X combo box's (cb) =>
    1ste cb = equipment nr.
    2de cb = partnr.
    3th cb = subpartnr.
    ....
    With the possibility to leave an combo box empty (no selection).

    At this moment when got somthing working, trough use of query criterias. When we give an input in all the cb, the selection is good, but when we leave 1 empty, the selection fails (a selection on empty cels is made). If we give a * in it works, but not automaticly. Its the formular with IF that fails,(if selection is made in cb, select this, or select all), how can we correct it.

    Please help me?

    Thanks
    KADANS
  • Stewart Ross
    Recognized Expert Moderator Specialist
    • Feb 2008
    • 2545

    #2
    Hi. Could you tell us how the combos are being used in your queries? If you are referring to the combos as query criteria in your queries (using, for example, like forms!formname! controlname in a criterion line) it will not work for null values - the 'no entry made yet' value. This can be dealt with using the Nz function to substitute the wildcard character '*' if the combo is null:

    like Nz(forms!formna me!controlname, "*")

    This only works for string value comparisons.

    On the other hand maybe your criteria is built in code - building up your criteria as a WHERE clause and filtering the data accordingly.

    If you could let us know we can advise you more specifically on what to do with the null combo values should you require it.
    -Stewart

    Comment

    Working...