Hi!
I have a form that once filled in, I have included a print button that filters the form for the current record and produces a report in print preview. This print preview always works, but when the user clicks the "print" button on the ribbon--about 1/2 the time, access crashes. Access has to be reopened and the report located to print again (embarrassing in front of customers waiting on their invoice). Any ideas?
Private Sub Print_Click()
Dim strWhere As String
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to print"
Else
strWhere = "[Transaction Number] = " & Me.[Transaction Number]
DoCmd.OpenReport "Rental Receipt", acViewPreview, , strWhere
End If
End Sub
Thanks for your help!