Appending the where clause in "OpenReport"

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

Guest

I have a form that lists up to 4 criteria for a report. My where clause for
the report is built using these fields. Each field can be a value or can be
null. If null, I want all records for that field. If they have a value, I
want only those fields in the report matching that field.

Right now the form only has two criteria so I have a macro with 4 lines for
the four possible true false scenarios. As the list grows (now need 4) I
don't want to list 16 possible solutions. Is there an easier way to append a
where clause. So, I can create a where based upon the first field and then
append it with the second or leave blank if no criteria is named?

Thanks in advance.
Dave
 
Dave,

I think you will find it is easier to reference the form controls in the
criteria of the query that the report is based on, rather than trying to
manage this via macro conditions.

Alternatively, you can use a VBA procedure to build a Where Condition
string, which should be a bit less long-winded than the macro conditions.
 
Back
Top