C
Corey-g via AccessMonster.com
Hi All,
I have a form that uses 4 combo boxes to pick items from. They are all
syncronized together, and for the most part this seems to work. But I have
added a test to see if there is only one value in the combo box after each
'after_update' event, and if so, set the value of the combo box to that value.
With FORM_frmRequest_Add
.cboPartNumber.RowSource = sSQL
.cboPartNumber.Requery
If .cboPartNumber.ListCount = 1 Then
.cboPartNumber.Value = .cboPartNumber.Recordset(0)
' .cboPartNumber = .cboPartNumber.recordset(0) - Tried this - no
luck
' .cboPartNumber = .cboPartNumber.itemdata(0) - Tried this - no
luck
End If
End With
I thought this was working, but I am getting
"Run-time error '2113':
The value you entered isn't valid for this field
I can't figure out why this is happening. When I look at the combo box in
the watch window, the 'recordset' property show <Object Invalid or no longer
set >
I also have a 'clear' button that sets all of the combo boxes to Null then re-
assigns the query to the rowsource and requeries it - if that helps.
Any thoughts on where I've gone wrong?
Corey
I have a form that uses 4 combo boxes to pick items from. They are all
syncronized together, and for the most part this seems to work. But I have
added a test to see if there is only one value in the combo box after each
'after_update' event, and if so, set the value of the combo box to that value.
With FORM_frmRequest_Add
.cboPartNumber.RowSource = sSQL
.cboPartNumber.Requery
If .cboPartNumber.ListCount = 1 Then
.cboPartNumber.Value = .cboPartNumber.Recordset(0)
' .cboPartNumber = .cboPartNumber.recordset(0) - Tried this - no
luck
' .cboPartNumber = .cboPartNumber.itemdata(0) - Tried this - no
luck
End If
End With
I thought this was working, but I am getting
"Run-time error '2113':
The value you entered isn't valid for this field
I can't figure out why this is happening. When I look at the combo box in
the watch window, the 'recordset' property show <Object Invalid or no longer
set >
I also have a 'clear' button that sets all of the combo boxes to Null then re-
assigns the query to the rowsource and requeries it - if that helps.
Any thoughts on where I've gone wrong?
Corey