I have attempted to use code from faq181-120 without success. Before explaining what I've done, this is what I want to achieve: 1). Select a parameter from a list in combo box on my form. 2). Click on the selection. 3). Open the parameter query - without the usual pop up dialog box - and 4). Run the query DIRECTLY from the selection with no intervening steps. Just click to reveal the list and click to select and open - nothing else! The code in my parameter query reads: [Forms]![my form name]![cboCombo115]. In the ON CLICK event of the combo box I have the following, which I know probably needs error handling:
Private Sub Combo115_Click()
On Error GoTo Err_Award_Parameter_Query_Click
Dim stDocName As String
stDocName = "TESTparameterquery"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Award_Parameter_Query_Click:
Exit Sub
Err_Award_Parameter_Query_Click:
MsgBox Err.Description
Resume Exit_Award_Parameter_Query_Click
End Sub
Bearing mind (please) that I am a complete novice with code, can you explain hoew to get this right? I would be most grateful for any assistance.
Thank you, Ted.
Private Sub Combo115_Click()
On Error GoTo Err_Award_Parameter_Query_Click
Dim stDocName As String
stDocName = "TESTparameterquery"
DoCmd.OpenQuery stDocName, acNormal, acEdit
Exit_Award_Parameter_Query_Click:
Exit Sub
Err_Award_Parameter_Query_Click:
MsgBox Err.Description
Resume Exit_Award_Parameter_Query_Click
End Sub
Bearing mind (please) that I am a complete novice with code, can you explain hoew to get this right? I would be most grateful for any assistance.
Thank you, Ted.