How do I test to see if a query is open so I may requery it as the combo boxes in my form are updated. I use a simple command button to open the query when the user has selected the approporiate criteria. If the query is already open then either close and reopen the query or requery. No fancy forms for the output as the user is just going to cut and paste data into Excel anyway.
I can open the query fine but when I change the criteria on the form the query does not update. I am using just the default output from the command button wizard.
I must be doing this in a wierd way as I found almost nothing by searching.
Thanks.
I can open the query fine but when I change the criteria on the form the query does not update. I am using just the default output from the command button wizard.
Code:
Private Sub cmd_run_store_inv_qry_Click()
On Error GoTo Err_cmd_run_store_inv_qry_Click
Dim stDocName As String
stDocName = "qry_store_inventory_from_form"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmd_run_store_inv_qry_Click:
Exit Sub
Err_cmd_run_store_inv_qry_Click:
MsgBox Err.Description
Resume Exit_cmd_run_store_inv_qry_Click
End Sub
Thanks.