Let access know which report I want to print.

G

geeves1293

Hi all,

I would like access to know what report I want to print.

In my form I select from a combo box what this document is going to be i.e.
enquiry,quotation,sales order, etc.

Each report is laid out differently to the other.

Can I tell access 'if combo box = enquiry, then print enquiry, if not repeat
if statement'?

Any help would be much appreciated.

Many Thanks

Graham
 
K

KARL DEWEY

There is more than one way to do it, here is one --
Use 2 columns for your combo data, numbers in first and text in second.
Number the reports 1 through last. Set Column Widths to 0"; 1.5" or
whatever is needed to display your text.

Use the After Update event of the combo to call a macro. In the macro have
action OpenReport and Report Name argument the name of first report. For
Where Condition use [Forms]![YourFormName]![ComboName] = 1 so when the combo
select first report that is what is run.
Repeat the action, argument, and condition for the rest, following the
report number sequence.
 
J

John W. Vinson

Hi all,

I would like access to know what report I want to print.

In my form I select from a combo box what this document is going to be i.e.
enquiry,quotation,sales order, etc.

Each report is laid out differently to the other.

Can I tell access 'if combo box = enquiry, then print enquiry, if not repeat
if statement'?

Any help would be much appreciated.

Many Thanks

Graham

You could store the report name (rptEnquiry say) as a column in the combo box,
and use the combo's AfterUpdate event to actually launch the report:

Private Sub cboWhichReport_AfterUpdate()
Dim strReport As String
strReport = Me!cboWhichReport.Column(2) ' get the third column
' in the combo's row source - it's zero based
DoCmd.OpenReport strReport, <optional arguments>
End Sub
 
G

geeves1293

Thank you all for your help.

Is is possible that I can fill in all my fields on form including this combo
box in question then push a print command button?

At the moment I have to have three print buttons (1 for each different
report).

Thanks again

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top