Hi, I am trying to create a report from vba with a condition.
So far I have tried:
Dim IntCompanyCode As Integer
DoCmd.OpenReport "Invoice", acViewPreview, , Inv_Nr = 15
and:
IntCompanyCode = 15
DoCmd.OpenReport "Invoice", acViewPreview
Invoice.Filter = "((Inv_Nr) = " & IntCompanyCode & " )"
Invoice.FilterOn = True
Invoice.Text1.Visible = False
'DoCmd.Close acReport, "rptPage1", acSaveYes
The report is built on a query where Inv_Nr is one of the fields formated as text
I know this is probably a pretty stupid question, but please help me anyway.
G
So far I have tried:
Dim IntCompanyCode As Integer
DoCmd.OpenReport "Invoice", acViewPreview, , Inv_Nr = 15
and:
IntCompanyCode = 15
DoCmd.OpenReport "Invoice", acViewPreview
Invoice.Filter = "((Inv_Nr) = " & IntCompanyCode & " )"
Invoice.FilterOn = True
Invoice.Text1.Visible = False
'DoCmd.Close acReport, "rptPage1", acSaveYes
The report is built on a query where Inv_Nr is one of the fields formated as text
I know this is probably a pretty stupid question, but please help me anyway.
G