I
injanib via AccessMonster.com
Hi
I have a form with a field name "txtInvoice". The record source of the field
is a field called "Invoice Number" in a table. The form has a subform too. I
have a button that is supposed to print which ever invoice I have pulled up,
so I have it coded as follows.
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = True
End If
strWhere = "[Invoice Number] = """ & Me.[txtInvoice] & """"
DoCmd.OpenReport "InvoiceReport", acViewPreview, , strWhere
End Sub
Everytime I click on the button I get a "Run-time error '2501', The
openreport action was canceled".
can someone tell me what the problem is.
I have a form with a field name "txtInvoice". The record source of the field
is a field called "Invoice Number" in a table. The form has a subform too. I
have a button that is supposed to print which ever invoice I have pulled up,
so I have it coded as follows.
Private Sub cmdPrint_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = True
End If
strWhere = "[Invoice Number] = """ & Me.[txtInvoice] & """"
DoCmd.OpenReport "InvoiceReport", acViewPreview, , strWhere
End Sub
Everytime I click on the button I get a "Run-time error '2501', The
openreport action was canceled".
can someone tell me what the problem is.