G
G13m
I have a form that has an unbound combo for filtering to a record in the
source table of the form. This is the code for the combo:
Private Sub cmbProductId_AfterUpdate()
If IsNull(Me.cmbProductId) Then ' Turn filter off
Me.Filter = vbNullString
Me.FilterOn = False
Else
Me.Filter = "[REPAIREVENTID] = '" & Me.cmbProductId & "'" ' Filter
for the selected Product
Me.FilterOn = True
End If
End Sub
The combo has a few columns but REPAIREVENTID is the bound column in the
combo dropdown.
When I select an item from the dropdown, I get Runtime error 2001 on the
'filter for [REPAIREVENTID]' line of code. Funny thing is I did a very
similar thing in another form and it works fine. RMA is a field in the source
table of the form:
Private Sub cmbRMA_AfterUpdate()
If IsNull(Me.cmbRMA) Then
' Turn filter off
Me.Filter = vbNullString
Me.FilterOn = False
Else
Me.Filter = "[RMA] = '" & Me.cmbRMA & "'" '
Filter for the selected RMA
Me.FilterOn = True
End If
Me!fsubEditRepairDetail.Enabled = True ' Enable the form for data
entry
Me.cmbCustomer.Enabled = True
Me.cmbCUSTPO.Enabled = True
Me.txtPODATE.Enabled = True
Me.tglShowCalendar.Enabled = True
Me.cmdDeleteRMA.Enabled = True
End Sub
The forms' and the combos' properties appear to be identical and I'm stumped.
Thanks for any help.
source table of the form. This is the code for the combo:
Private Sub cmbProductId_AfterUpdate()
If IsNull(Me.cmbProductId) Then ' Turn filter off
Me.Filter = vbNullString
Me.FilterOn = False
Else
Me.Filter = "[REPAIREVENTID] = '" & Me.cmbProductId & "'" ' Filter
for the selected Product
Me.FilterOn = True
End If
End Sub
The combo has a few columns but REPAIREVENTID is the bound column in the
combo dropdown.
When I select an item from the dropdown, I get Runtime error 2001 on the
'filter for [REPAIREVENTID]' line of code. Funny thing is I did a very
similar thing in another form and it works fine. RMA is a field in the source
table of the form:
Private Sub cmbRMA_AfterUpdate()
If IsNull(Me.cmbRMA) Then
' Turn filter off
Me.Filter = vbNullString
Me.FilterOn = False
Else
Me.Filter = "[RMA] = '" & Me.cmbRMA & "'" '
Filter for the selected RMA
Me.FilterOn = True
End If
Me!fsubEditRepairDetail.Enabled = True ' Enable the form for data
entry
Me.cmbCustomer.Enabled = True
Me.cmbCUSTPO.Enabled = True
Me.txtPODATE.Enabled = True
Me.tglShowCalendar.Enabled = True
Me.cmdDeleteRMA.Enabled = True
End Sub
The forms' and the combos' properties appear to be identical and I'm stumped.
Thanks for any help.