chuckcoleman
Registered User.
- Local time
- Today, 01:16
- Joined
- Aug 20, 2010
- Messages
- 363
Hi, I want to use the same report with different. If the user is on Form "A" and they click on a button it will use:
Private Sub Command105_Click()
Dim WhichQuery As String
WhichQuery = "Invoice Query-3-Bulk-Reinvoice"
DoCmd.OpenReport "Invoice Report-BulkTest", acViewPreview, WhichQuery
End Sub
If they click on a different button, the value for WhichQuery would be different.
I assume you leave in the report on the data tab the Record Source would be blank. It is my understanding that the Filter parameter in OpenReport can be a query. Therefore I'm trying to pass the value of WhichQuery to the report so it uses that query. When I run the code I get a "The action or method is invalid because the form or report isn't bound to a table or query."
What am I doing wrong?
Thanks,
Chuck
Private Sub Command105_Click()
Dim WhichQuery As String
WhichQuery = "Invoice Query-3-Bulk-Reinvoice"
DoCmd.OpenReport "Invoice Report-BulkTest", acViewPreview, WhichQuery
End Sub
If they click on a different button, the value for WhichQuery would be different.
I assume you leave in the report on the data tab the Record Source would be blank. It is my understanding that the Filter parameter in OpenReport can be a query. Therefore I'm trying to pass the value of WhichQuery to the report so it uses that query. When I run the code I get a "The action or method is invalid because the form or report isn't bound to a table or query."
What am I doing wrong?
Thanks,
Chuck