Solved
Hiding queries when opened from dialog box
Posted on 2002-06-04
How might you hide a query in code when it is being opened from the On Click event procedure? I have a dialog box that passes parameters to 6 different queries and the query results are displayed in a report. When the command button for the dialog box is clicked, all 6 queries open and then the report displaying the results. Current code looks like this:
Private Sub cmdRunContribTransCountQry_Click()
On Error GoTo Err_cmdRunContribTransCountQry_Click
DoCmd.OpenQuery "qryContribTransCount", acNormal, acEdit
DoCmd.OpenQuery "qryDistribTransCount", acNormal, acEdit
DoCmd.OpenQuery "qryLoansTransCount", acNormal, acEdit
DoCmd.OpenQuery "qryContribElapsedAvg", acViewNormal, acEdit
DoCmd.OpenQuery "qryDistribElapsedAvg", acViewNormal, acEdit
DoCmd.OpenQuery "qryLoansElapsedAvg", acViewNormal, acEdit
DoCmd.OpenReport "rptERScorecard", acViewPreview
Exit_cmdRunContribTransCountQry_Click:
Exit Sub
Err_cmdRunContribTransCountQry_Click:
MsgBox Err.Description
Resume Exit_cmdRunContribTransCountQry_Click
End Sub
Any suggestions?