Printing a different invoice layout based on check box

  • Thread starter Thread starter chang
  • Start date Start date
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
 
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
 
Back
Top