Printing a different invoice layout based on check box

C

chang

How can I set it up that it will use a diffrent report view based on wich
checkbox is selected?

rinting a different invoice layout based on check box
 
A

Allen Browne

This is an unbound checkbox, so you can choose the layout at print time?
This example chooses the graphic layout or the plain layout, and prints the
current record in the form. "chkPrintGraphic" is the unbound check box:

Private Sub cmdPreview_Click()
Dim strDoc As String

If Me.chkPrintGraphic.Value Then
strDoc = "rptInvoiceGraphic"
Else
strDoc = "rptInvoicePlain"
End If

If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
Beep
Else
DoCmd.OpenReport strDoc, acViewPreview, , "InvoiceID = " &
Me.InvoiceID
End If
End Sub
 

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