M
maud.july
Hello,
I'm new to Access and have a very basic question. I want to open a
report when a user clicks a button on a form. Now since I can open a
form through a button click by pasting:
=OpenForms("FormName") in the "On Click" setting in the properties
menu, I would assuming using:
=OpenReport("ReportName")
would be the trick. But it's not. Many of the examples on the net I
have found use lines such as:
docmd.OpenReport "rpt_name", acViewPreview, "",
But when I try this I just get an error saying that the marco docmd
can't be found. In the sample database in Access when I click "Build
Event" on a button that produces a report, I see code of the form:
Private Sub Print_Click()
' Print selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acNormal
End Sub
but when I click on "Buid Event" on the button in my form and try to
past in analogus code (to a screen that looks different compared to
the sample database) it just gives errors and more errors.
Thanks.
I'm new to Access and have a very basic question. I want to open a
report when a user clicks a button on a form. Now since I can open a
form through a button click by pasting:
=OpenForms("FormName") in the "On Click" setting in the properties
menu, I would assuming using:
=OpenReport("ReportName")
would be the trick. But it's not. Many of the examples on the net I
have found use lines such as:
docmd.OpenReport "rpt_name", acViewPreview, "",
But when I try this I just get an error saying that the marco docmd
can't be found. In the sample database in Access when I click "Build
Event" on a button that produces a report, I see code of the form:
Private Sub Print_Click()
' Print selected report. This procedure uses the PrintReports
' Sub procedure defined in (General) section of this module.
PrintReports acNormal
End Sub
but when I click on "Buid Event" on the button in my form and try to
past in analogus code (to a screen that looks different compared to
the sample database) it just gives errors and more errors.
Thanks.