Villarreal68
Registered User.
- Local time
- Today, 03:18
- Joined
- Feb 15, 2007
- Messages
- 133
Hello Everyone,
I'm working with this code (same as earlier post), bur different error:
I know for sure that the data in column(0) is valid in the table. I even tried creating a textbox that reflects the data on column(0) to try and pick up the data from there (as you can see above), but I still get the following error:
" 3265 Item not found on this collection"
Any help is appreciated...
I'm working with this code (same as earlier post), bur different error:
Code:
Dim rst As DAO.Recordset
Dim db As DAO.Database
Dim ctl As Control
Dim varItem As Variant
'On Error GoTo Err_btnAceptar
Set db = CurrentDb()
Set rst = CurrentDb.OpenRecordset("CheckOut")
[COLOR=yellowgreen] Set ctl = Me.lstAfuera 'FIXED THANKS TO TONY[/COLOR]
'Make sure an item has been selected.
If ctl.ItemsSelected.count = 0 Then
MsgBox "Primero Selecciona un Territorio Para Aceptar."
Exit Sub
End If
For Each varItem In ctl.ItemsSelected
[COLOR=red]'rst!Position = ctl.Column(0, varItem)
'rst.Seek "=", txtCheckOutID
rst!Position = txtCheckOutID This is my new issue...
[/COLOR] rst.Edit
rst!CheckInDate = Me.txtDate2
rst.Update
DoCmd.GoToRecord , , acGoTo, txtTerrIn
Me.TerrOut = False
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Aceptado"
Next varItem
Exit_btnAceptar:
rst.Close
Set rst = Nothing
Set ctl = Nothing
Me.lstAfuera.Requery
Me.lstDisponibles.Requery
Exit Sub
Err_btnAceptar:
If Err.Number = 3314 Then
MsgBox "Primero Asigna a un publicador."
Exit Sub
End If
If Err.Number = 3421 Then
MsgBox "Primero Asigna a un publicador."
Exit Sub
End If
MsgBox Err.Number & Err.Description
Resume Exit_btnAceptar
I know for sure that the data in column(0) is valid in the table. I even tried creating a textbox that reflects the data on column(0) to try and pick up the data from there (as you can see above), but I still get the following error:
" 3265 Item not found on this collection"
Any help is appreciated...