jazminecat
Programmer
Hi - I have a parameter query that I want to run from a button on a simple form. The parameter query only takes a yes or no, and then results are returned based on that. The form has an option group called SubRecipYN, where the user selects on of the two items.
I need to then pass that selection to a parameter query called SubrecipientReport. This query will be used to populate a report. (down the line, this button click will also open that report, but for now, I just want to run that report's source query.
I am unable to even figure out how to open thw query, so I'm either clueless or not awake. I have this in the onclkick even of the button on my form:
But even this it says the action or method requires a Query Name or argument.
If I use this line:
DoCmd.OpenQuery (SubrecipientReport,acViewNormal,acEdit)
when I try to close the vb window it says it's expecting an = so there appears to be more required than this? Can anyone point me in the right direction here?
thank you!
I need to then pass that selection to a parameter query called SubrecipientReport. This query will be used to populate a report. (down the line, this button click will also open that report, but for now, I just want to run that report's source query.
I am unable to even figure out how to open thw query, so I'm either clueless or not awake. I have this in the onclkick even of the button on my form:
Code:
Private Sub cmdRunQry_Click()
On Error GoTo Err_cmdRunQry_Click
DoCmd.OpenQuery (SubrecipientReport)
Exit_cmdRunQry_Click:
Exit Sub
Err_cmdRunQry_Click:
MsgBox Err.Description
Resume Exit_cmdRunQry_Click
End Sub
But even this it says the action or method requires a Query Name or argument.
If I use this line:
DoCmd.OpenQuery (SubrecipientReport,acViewNormal,acEdit)
when I try to close the vb window it says it's expecting an = so there appears to be more required than this? Can anyone point me in the right direction here?
thank you!