I'm using MS Access 2003.
I have a tabular form that simply runs a query and displays data. Before the query fires, I want to display a parameter-collection form so the user can filter the results before they appear. The SQL would grab the parameters from the open parameter-collection form before firing. Question: Where do I place the code that opens the parameter-collection form?
I've tried to add the code to the Open event, but apparently it fires after the SQL executes. I've also tried to add it to the Activate event and the Before Query event, but no luck.
BTW, I've successfully done something similar for reports: if I place my VBA code that opens the parameter form in the Open event of the report, it works. But forms must be different animals.
In case it helps, here's my VBA code:
Thanks for any help you can give.
Wayne
I have a tabular form that simply runs a query and displays data. Before the query fires, I want to display a parameter-collection form so the user can filter the results before they appear. The SQL would grab the parameters from the open parameter-collection form before firing. Question: Where do I place the code that opens the parameter-collection form?
I've tried to add the code to the Open event, but apparently it fires after the SQL executes. I've also tried to add it to the Activate event and the Before Query event, but no luck.
BTW, I've successfully done something similar for reports: if I place my VBA code that opens the parameter form in the Open event of the report, it works. But forms must be different animals.
In case it helps, here's my VBA code:
Code:
' Set public variable to true to indicate that the report is in the Open event
GblnInReportOpenEvent = True
' Make Switchboard invisible
Forms!frmSwitchboard.Visible = False
DoEvents
' Open Dialog to collect parms
DoCmd.OpenForm "frmRptFinTxSummaryByPortTypeClaimTypeParms", , , , , acDialog
' Cancel Report if User Clicked the Cancel Button
If fIsLoaded("frmRptFinTxSummaryByPortTypeClaimTypeParms") = False Then
Cancel = True
Else
DoCmd.Maximize
End If
' Set public variable to false to indicate that the Open event is completed
GblnInReportOpenEvent = False
Thanks for any help you can give.
Wayne