Print Specific Report Based on Combo Selection?

phn

Registered User.
Local time
Today, 08:14
Joined
Mar 17, 2006
Messages
21
Hi

I need to print a specific form based on the selection made on a combo box.

I have been able to set it up to open the relevant form when the user selects an option from the combo box, but am unable to find a way to be able to print the specific report based on the selection.

I have a command button which prints a report based on the data in my current form, but would like it to also print the specific form based on the combo box selection.

Is this possible, and if so how is it possible?

Thanks in advance,

me
 
Why print the form? A report based on the record shown in the form should be good enough?
 
What I meant was a report. When the user selects the options in the form it generates a report, but there are 2 reports.

My command button current prints a report based on the data in the current form, and also the kit checklist which is named rptPD170, but I have specified this form to be printed.

What I need to do is have a function where the report printed is dependant upon the option the user selects from the combo box.

Currently it has:

1 : PD170P : frmPD170 > rptPD170
2 : DSR450 : frmDSR450 > rptDSR450
3 : OTHER : frmOTHER > rptOTHER

When the user selects an option from the list, the relevant form pops up and the user selects the items that have been booked.

What I can't get it to do is print the relevant report based on the combo selection.

I hope this makes things a bit clearer, and I hope someone can offer some help..

Thanks!
 
The simplest way would be to have your combo box show all the reports. This way you wouldn't have to have a seperate form for the user to select the report. Put this line of code in the row source of your combo box.

SELECT MsysObjects.Name FROM MsysObjects WHERE (((Left$([Name],1))<>"~" And (Left$([Name],1))<>"Z") AND ((MsysObjects.Type)=-32764)) ORDER BY MsysObjects.Name;

This shows all the reports in your DB, with the exception of those starting with Z You can obviously change or delete this as necessary.

Next, you will need to print the selected report. In the after update event of the combo box something like this

DoCmd.OpenReport Me.Combo0, acViewNormal

David
 
Last edited:
Woohoo I got it working using the steps you described above, thankyou!
 
David

"Next, you will need to print the selected report. In the after update event of the combo box something like this

DoCmd.OpenReport Me.Combo0, acViewNormal"

What if you just want to view the report not print it?

**Update** Nevermind I figured it out acPreview....... **Update**

Thanks
R~
 
Last edited:

Users who are viewing this thread

Back
Top Bottom