G
guilin
I have struggled on this for about a week.........
Have a command button to open/preview report from a form. I want it to
open the report for the current report. I used:
********Code start*********
Private Sub cmdPreviewInvoice_Click()
On Error GoTo Err_cmdPreviewInvoice_Click
Dim stDocName As String
stDocName = "rptPrintInvoice"
DoCmd.OpenReport stDocName, acPreview, "", InvoiceID =
Me.InvoiceID, acWindowNormal
Exit_cmdPreviewInvoice_Click:
Exit Sub
Err_cmdPreviewInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewInvoice_Click
End Sub
*******Code end***********
which opened the whole report without filtering. there's no error msg
Thanks for any advice!!!
Have a command button to open/preview report from a form. I want it to
open the report for the current report. I used:
********Code start*********
Private Sub cmdPreviewInvoice_Click()
On Error GoTo Err_cmdPreviewInvoice_Click
Dim stDocName As String
stDocName = "rptPrintInvoice"
DoCmd.OpenReport stDocName, acPreview, "", InvoiceID =
Me.InvoiceID, acWindowNormal
Exit_cmdPreviewInvoice_Click:
Exit Sub
Err_cmdPreviewInvoice_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewInvoice_Click
End Sub
*******Code end***********
which opened the whole report without filtering. there's no error msg
Thanks for any advice!!!