Need print answer

G

Guest

I have an option group on a form that will allow the user to print either the
individual invoice showing or all of the invoices for that date. For example,
on the form, the user chooses a date from a combo box. All of the invoices
for that date come up, you can scroll through the invoices by the record
selectors at the bottom. Only one invoice shows at a time. In my option
group, the user has two choices, either print the invoice showing or print
all of the invoices for that date.

Can someone tell me how I can get this to work? I want to be able to print
to two reports, that will also be created, one for the individual invoice and
one for all the invoices.

Thanks
 
S

Steve Schapel

Antney,

I don't think you will need to make two separate reports. It is the
same report, just the criteria used in determining the records included
that is varied.

It seems to me, therefore, that you can control this via the Where
Condition argument of the OpenReport method. Your code might look
something like this...

Select Case Me.YourOptionGroup
Case 1 ' current record
DoCmd.OpenReport "Invoice", , ,"[InvoiceNumber] =" & Me.InvoiceNumber
Case 2 ' selected date
DoCmd.OpenReport "Invoice", , ,"[InvoiceDate] =" & CLng(Me.DateCombo)
End Select
 
G

Guest

Thanks Steve, I'll try it.

Steve Schapel said:
Antney,

I don't think you will need to make two separate reports. It is the
same report, just the criteria used in determining the records included
that is varied.

It seems to me, therefore, that you can control this via the Where
Condition argument of the OpenReport method. Your code might look
something like this...

Select Case Me.YourOptionGroup
Case 1 ' current record
DoCmd.OpenReport "Invoice", , ,"[InvoiceNumber] =" & Me.InvoiceNumber
Case 2 ' selected date
DoCmd.OpenReport "Invoice", , ,"[InvoiceDate] =" & CLng(Me.DateCombo)
End Select

--
Steve Schapel, Microsoft Access MVP
I have an option group on a form that will allow the user to print either the
individual invoice showing or all of the invoices for that date. For example,
on the form, the user chooses a date from a combo box. All of the invoices
for that date come up, you can scroll through the invoices by the record
selectors at the bottom. Only one invoice shows at a time. In my option
group, the user has two choices, either print the invoice showing or print
all of the invoices for that date.

Can someone tell me how I can get this to work? I want to be able to print
to two reports, that will also be created, one for the individual invoice and
one for all the invoices.

Thanks
 

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