Open correct report (1 Viewer)

foxtet

Registered User.
Local time
Today, 16:07
Joined
May 21, 2011
Messages
129
I have a billing form. After input necessary data I want invoice to be created. When I press create invoice button it displays different invoice.

how to handle this?

foxtet
 

JHB

Have been here a while
Local time
Today, 13:07
Joined
Jun 17, 2012
Messages
7,732
How do you open the report, code or??
If code then show it.
 

foxtet

Registered User.
Local time
Today, 16:07
Joined
May 21, 2011
Messages
129
I use the following command. it displays all records.but I want display specific record.
Private Sub cmdInv_Click()

Dim strReportname As String
Dim strCriteria As String

strReportname = "rptInvoice"
strCriteria = "[InvNo] = & Me.InvNo"

DoCmd.OpenReport strReportname, acViewPreview, strCriteria

End Sub

foxtet
 

Minty

AWF VIP
Local time
Today, 12:07
Joined
Jul 26, 2013
Messages
10,355
Assuming InvNo is a number you need

strCriteria = "[InvNo] = " & Me.InvNo
 

Users who are viewing this thread

Top Bottom