I have set up a button on a contact form to print out the mailing address of only the record displaying. However, I get a type mismatch error irregularly. Sometimes it works, sometimes it doesn't. Below is the code that the click event triggers.
Option Compare Database
Private Sub btnPrintrptHouseHolderEnvelope_Click()
On Error GoTo Err_btnPrintrptHouseHolderEnvelope_Click
Dim stDocName As String
stDocName = "rptHouseHolderEnvelope"
DoCmd.OpenReport stDocName, acPreview, , "HouseHolderID = " & Me![HouseHolderID]
Exit_btnPrintrptHouseHolderEnvelope_Click:
Exit Sub
Err_btnPrintrptHouseHolderEnvelope_Click:
MsgBox Err.Description
Resume Exit_btnPrintrptHouseHolderEnvelope_Click
End Sub
I have been racking my brain to try and find a common thread on the mismatch, but am at a loss to come up with any other possible cause for the error.