Report generator

macca_24

New member
Local time
Today, 18:36
Joined
Apr 1, 2003
Messages
8
Hi,

I have a form with some fields and a button. The fields are dropdowns to a table where I can select certain criteria such as "proposer" or "status" into the fields. I then click the button and it kicks off the following code:
Dim stDocName As String

stDocName = "STATUS REPORT"
DoCmd.OpenReport stDocName, acPreview

The above opens a form called Status Report and uses the criteria I selected previously in the form to populate the Status Report. The report is based on a query.

In the Status field of the form the Status can be selected as one of the following: Commenced, Completed, Under Consideration.
My problem is that I want to be able to leave the Status field and the other fields blank in the form and when I click the button then the report will be generated and it will contain all the information and will not have been filtered with the criteria selections. The new report will contain everything with all the above mentioned status etc. and will not contain just one status as would be selected.

Any help much appreciated.

Thanks,

Macca
 
Hi,

If you have a look at the Solutions example database there is an example and step by step guide on how to do this.

Matt
 
were can I find the Solutions example database??
 
Sorry,

I have actually mis read your post. What i was thinking of is adding all to your combo box and not actually the report.


Matt
 
Last edited:
Ok,

This is what you need to do:

Open up your query in design view and place the following around your criteria in the selected column:

Like '*' & [Your criteria] & '*'

This will allow either a null entry where all data is returned or restricted data by entered criteria.

Matt
 

Users who are viewing this thread

Back
Top Bottom