J
jrp444
I am trying to populate a table from a form that I am pulling information in
from other tables. I am trying to get it when I enter the date that it will
insert the information into the table. I am getting an errror (There was an
error adding the record.3001, Arguments are of the wrong tyype, are out of
acceptable range, or are in conflict with one another). I have check the
spell and the names in my module and every thing seems to be ok. Could
somebody please help me firgure out why I am getting this error. Below is my
Module:
Private Sub dated_AfterUpdate()
Dim sql As String
Dim rsAdd As New ADODB.Recordset
On Error GoTo DbError
'Assign updatable cursor and lock type properties.
rsAdd.CursorType = adOpenDynamic
rsAdd.LockType = adLockOptimistic
'Opening recordset object
rsAdd.Open "tbl_Issued", remoteConnection, , , adCmdTable
With rsAdd
..AddNew
!ID = Me.ID
!Commodity = Me.txt_comm
!Trailer_no = Me.txt_Trl_no
!county = Me.txt_county
!driver = Me.txt_driver
!Web_EOC = Me.txt_eoc
!D_Date = Me.dated
..Update
..Close
End With
MsgBox "Record Added.", vbInformation
'‘Close the form-level Recordset object and refresh
'‘it to include the newly updated row.
'rsAdjustors.Close
'SetRecordset
Exit Sub
DbError:
MsgBox "There was an error adding the record." _
& Err.Number & ", " & Err.Description
End Sub
Thanks!
from other tables. I am trying to get it when I enter the date that it will
insert the information into the table. I am getting an errror (There was an
error adding the record.3001, Arguments are of the wrong tyype, are out of
acceptable range, or are in conflict with one another). I have check the
spell and the names in my module and every thing seems to be ok. Could
somebody please help me firgure out why I am getting this error. Below is my
Module:
Private Sub dated_AfterUpdate()
Dim sql As String
Dim rsAdd As New ADODB.Recordset
On Error GoTo DbError
'Assign updatable cursor and lock type properties.
rsAdd.CursorType = adOpenDynamic
rsAdd.LockType = adLockOptimistic
'Opening recordset object
rsAdd.Open "tbl_Issued", remoteConnection, , , adCmdTable
With rsAdd
..AddNew
!ID = Me.ID
!Commodity = Me.txt_comm
!Trailer_no = Me.txt_Trl_no
!county = Me.txt_county
!driver = Me.txt_driver
!Web_EOC = Me.txt_eoc
!D_Date = Me.dated
..Update
..Close
End With
MsgBox "Record Added.", vbInformation
'‘Close the form-level Recordset object and refresh
'‘it to include the newly updated row.
'rsAdjustors.Close
'SetRecordset
Exit Sub
DbError:
MsgBox "There was an error adding the record." _
& Err.Number & ", " & Err.Description
End Sub
Thanks!