I used the wizard to put a combo box on a form with a list of query names. Using store value for later use. I just want to run a query based on the selection. When I try to select the query name from the drop down nothing happens. How do I get the value of my selection to stick. Then maybe I could use a command button to run the query.
I tried this:
Private Sub cmdRunQuery_Click()
On Error GoTo Err_cmdRunQuery_Click
Dim stQueryName As String
Dim stDocName As String
stQueryName = Forms![Access Identity Management].[cmbQueryName]
stDocName = stQueryName
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdRunQuery_Click:
Exit Sub
Err_cmdRunQuery_Click:
MsgBox Err.Description
Resume Exit_cmdRunQuery_Click
I tried this:
Private Sub cmdRunQuery_Click()
On Error GoTo Err_cmdRunQuery_Click
Dim stQueryName As String
Dim stDocName As String
stQueryName = Forms![Access Identity Management].[cmbQueryName]
stDocName = stQueryName
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_cmdRunQuery_Click:
Exit Sub
Err_cmdRunQuery_Click:
MsgBox Err.Description
Resume Exit_cmdRunQuery_Click