Hello all,
I have a combo box called cboOSC on a form frm94. The combo box is populated by a subform. I want to dblclick on cboOSC to bring up another form called frmOSC. The frmOSC needs to be filtered by the value in cboOSC. When frmOSC pops up, it asks to input a parameter value. In the parameter value box, my cboOSC value is listed above the blank text box. If I put in the value that is currently in the cboBox, it works fine. I don't want to have to input any value. The code I'm using is:
Private Sub cboOSC_DblClick(Cancel As Integer)
On Error GoTo cboOSC_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOSC"
stLinkCriteria = "[OSC] = " & Forms![frm94]![cboOSC]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.RunCommand acCmdApplyFilterSort
Exit_cboOSC_DblClick:
Exit Sub
cboOSC_DblClick:
MsgBox Err.Description
Resume Exit_cboOSC_DblClick
End Sub
Please let me know if there is anything obvious I'm missing.
Mike
I have a combo box called cboOSC on a form frm94. The combo box is populated by a subform. I want to dblclick on cboOSC to bring up another form called frmOSC. The frmOSC needs to be filtered by the value in cboOSC. When frmOSC pops up, it asks to input a parameter value. In the parameter value box, my cboOSC value is listed above the blank text box. If I put in the value that is currently in the cboBox, it works fine. I don't want to have to input any value. The code I'm using is:
Private Sub cboOSC_DblClick(Cancel As Integer)
On Error GoTo cboOSC_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmOSC"
stLinkCriteria = "[OSC] = " & Forms![frm94]![cboOSC]
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.RunCommand acCmdApplyFilterSort
Exit_cboOSC_DblClick:
Exit Sub
cboOSC_DblClick:
MsgBox Err.Description
Resume Exit_cboOSC_DblClick
End Sub
Please let me know if there is anything obvious I'm missing.
Mike