G
Guest
With the code below I'm trying to change the row source for a combo box on a
form. Problem is that when Case Is = 2, I get the correct record set but when
I click on an item in the list it displays a different record. If the record
I click on is, for example, Medtronic PacerX, I get Medtronic PacerY or Z or
something other than the selection I made.
Any help would be greatly appreciated. Thanks, Rob
*********************************************************
Private Sub cmdMedtronicFilter_Click()
On Error GoTo cmdMedtronicFilter_Click_Error
Dim DeviceType As String
DeviceType = Nz(Me.optGroupDeviceType, "")
Select Case DeviceType
Case Is = 1
Me.cboPacerExplant.RowSource = "SELECT * FROM qryPacersLU " & _
"WHERE fldManufacturerNo =('2') " & "ORDER BY fldModelName"
Case Is = 2
Me.cboPacerExplant.RowSource = "SELECT * FROM qryICDlu " & _
"WHERE fldManufacturerNo = ('2') " & "ORDER BY fldModelName"
End Select
On Error GoTo 0
Exit Sub
cmdMedtronicFilter_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdMedtronicFilter_Click of VBA Document Form_frmDevices"
End Sub
form. Problem is that when Case Is = 2, I get the correct record set but when
I click on an item in the list it displays a different record. If the record
I click on is, for example, Medtronic PacerX, I get Medtronic PacerY or Z or
something other than the selection I made.
Any help would be greatly appreciated. Thanks, Rob
*********************************************************
Private Sub cmdMedtronicFilter_Click()
On Error GoTo cmdMedtronicFilter_Click_Error
Dim DeviceType As String
DeviceType = Nz(Me.optGroupDeviceType, "")
Select Case DeviceType
Case Is = 1
Me.cboPacerExplant.RowSource = "SELECT * FROM qryPacersLU " & _
"WHERE fldManufacturerNo =('2') " & "ORDER BY fldModelName"
Case Is = 2
Me.cboPacerExplant.RowSource = "SELECT * FROM qryICDlu " & _
"WHERE fldManufacturerNo = ('2') " & "ORDER BY fldModelName"
End Select
On Error GoTo 0
Exit Sub
cmdMedtronicFilter_Click_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure
cmdMedtronicFilter_Click of VBA Document Form_frmDevices"
End Sub