DS said:
I'm trying to open a report from a textbox. What is the syntax for this?
DoCmd.OpenReport "' & Me.Textbox.Value & '", acViewPreview
Thanks
I have seen people display a list of their reports in a Combo or List Box.
I've never seen an experienced Access developer force the user to type in
the name of the report into a Text Box. Can you explain _why_ you would do
that?
In a sample application I have, the Combo Box "Combo0" contains a value list
of Reports from which the user can choose and the following code opens the
chosen Report in Preview.
Private Sub Combo0_AfterUpdate()
DoCmd.OpenReport Me!Combo0, acViewPreview
End Sub
Those are sample (test) reports demonstrating various features of Access
Reports.
In my real-world applications most Reports are opened on only the required
subset of the Records, so would not have such a simple DoCmd.OpenReport --
the DoCmd.OpenReport in that case would have a WhereCondition argument, or a
filter, specified.
Larry Linson
Microsoft Office Access MVP