I have a command button in a main menu that when clicked opens up a report. That report is based on a query.
The problem is that the particular query is used for two reports (it is queried by a different variable - open or closed). I want to write code in the command button for the report that is for only opened grants (and then i'll do it for the closed grant report) that says:
Status = "O"
In the query I have a where clause (where code = [Status])that goes by the value of code (can be O or C). right now it keeps asking the user tp tyoe it in but I don't want that to happen becasue if the user clicked the open grant report button, then I know that the status should be "O" (for open).
Any suggestions?
Right now I have:
Dim Status As String
Status = "O"
stDocName = "Rpt_Open_Grant_Reports"
DoCmd.OpenReport stDocName, acPreview
And when I run it , it still asks me for the status.
THANKS!
The problem is that the particular query is used for two reports (it is queried by a different variable - open or closed). I want to write code in the command button for the report that is for only opened grants (and then i'll do it for the closed grant report) that says:
Status = "O"
In the query I have a where clause (where code = [Status])that goes by the value of code (can be O or C). right now it keeps asking the user tp tyoe it in but I don't want that to happen becasue if the user clicked the open grant report button, then I know that the status should be "O" (for open).
Any suggestions?
Right now I have:
Dim Status As String
Status = "O"
stDocName = "Rpt_Open_Grant_Reports"
DoCmd.OpenReport stDocName, acPreview
And when I run it , it still asks me for the status.
THANKS!