bonekrusher
Registered User.
- Local time
- Today, 01:34
- Joined
- Nov 19, 2005
- Messages
- 266
I have 2 list boxes, where you can move items from one list box to another. It works fine except when there is certian data. 95% of my data works and select items don't. I get the following error "Runtime Error '3001' Arguments are of the wrong type, are out of acceptable
range or are in conflict with one another"
here is the code:
Private Sub cmdAdd_Click()
Dim conn As ADODB.Connection
Dim MyRS As ADODB.Recordset
Dim SelItem As Control
' set SelItem = to the selected item.
Set SelItem = Me.ListYes
If IsNull(SelItem) Then
MsgBox "You have to select an item! Please select an item from the list."
Else
' set up the connection and recordset.
Set conn = CurrentProject.Connection
Set MyRS = New ADODB.Recordset
' open the recordset.
MyRS.Open "Table1", conn, adOpenDynamic, adLockOptimistic
With MyRS
' find the record for the selected item.
.Find "List_Item = '" & SelItem & "'"
' set the Yes-No_Fld of the selected record to "No".
.Fields("Yes-No_Fld").Value = "No"
.Update
End With
Set MyRS = Nothing
Set conn = Nothing
' make sure the list boxes have the current values.
Me.ListYes.Requery
Me.ListNo.Requery
End If
End Sub
range or are in conflict with one another"
here is the code:
Private Sub cmdAdd_Click()
Dim conn As ADODB.Connection
Dim MyRS As ADODB.Recordset
Dim SelItem As Control
' set SelItem = to the selected item.
Set SelItem = Me.ListYes
If IsNull(SelItem) Then
MsgBox "You have to select an item! Please select an item from the list."
Else
' set up the connection and recordset.
Set conn = CurrentProject.Connection
Set MyRS = New ADODB.Recordset
' open the recordset.
MyRS.Open "Table1", conn, adOpenDynamic, adLockOptimistic
With MyRS
' find the record for the selected item.
.Find "List_Item = '" & SelItem & "'"
' set the Yes-No_Fld of the selected record to "No".
.Fields("Yes-No_Fld").Value = "No"
.Update
End With
Set MyRS = Nothing
Set conn = Nothing
' make sure the list boxes have the current values.
Me.ListYes.Requery
Me.ListNo.Requery
End If
End Sub