Report from Query by Form (1 Viewer)

tomc

Registered User.
Local time
Today, 19:21
Joined
Jul 27, 2000
Messages
40
I am using a query form to search a rather large database. The form has close to twenty fields on it. Rather than having a user page through the results of any search, I'd like to be able to print out the results in a standard report format that I have using a command buttom at the bottome of the query form. An ad hoc report, if you will.

Any ideas on how to do this will be greatly appreciated.

Tom
 

llkhoutx

Registered User.
Local time
Today, 13:21
Joined
Feb 26, 2001
Messages
4,018
Save your form as a report and modify it as may be necessary.
 

tomc

Registered User.
Local time
Today, 19:21
Joined
Jul 27, 2000
Messages
40
I've taken a stab at that but what I get is a duplicate of the form with one record per page. I only want to capture 8 fields per record and to have them formatted into a list with each record using 3 or 4 lines of the report. In other words, I guess I want to run the query and have the resulting recordset dumped into a report with the touch of a command button. This will be done by people unfamiliar with Access so it must be done with mouse clicks.

Tom
 

David R

I know a few things...
Local time
Today, 13:21
Joined
Oct 23, 2001
Messages
2,633
Will the fields always be the same? If your user can choose what fields are in the report, I'm not sure how to help you. However if only the filtering criteria will be variable, there is hope yet, young Skywalker.

At the bottom of your query form, have two buttons: "Display Results in Form", "Print Results in Report". (or whatever). Build your filter the same in each but just use DoCmd.OpenForm for one and DoCmd.OpenReport for the other.

Does that make sense?
 

tomc

Registered User.
Local time
Today, 19:21
Joined
Jul 27, 2000
Messages
40
Thanks, Obi, I'll give that a try. As I said, the form has about 20 fields any of which the user can query on. The resulting report, however, will only have 8 or so fields in a standard format. I've got to run now but will give it a try tomorrow morning.

Thanks for your and anyone else's help.

Tom
 

tomc

Registered User.
Local time
Today, 19:21
Joined
Jul 27, 2000
Messages
40
When I click on a preview report button all I get is a duplicate of the form as a report. I want users to be able to search on any of 30 fields and print the results in a report with 20 fields on it, 11 of which are in the detail for each record. Not every field on the form will have a value in it so doing a query for the report based on values in the result fields using "is null" will be quite cumbersome.

Thanks, again, Tom
 

David R

I know a few things...
Local time
Today, 13:21
Joined
Oct 23, 2001
Messages
2,633
I would say the best way to go would be to look at the DoCmd.OpenReport method in help and use the WHERE clause to dynamically etll your report the criteria for the data it will open. You should be able to do that from your popup form.
 

Users who are viewing this thread

Top Bottom