Hi I have a simple recordset. the code is running okay until it reaches "rs!VesselID = txtVessel" in my code and it returds error 3164. I tried to manipulate the data in query form and I'm able to edit the field VesselID but when it is in recordseet it gives me an error. Please see my code below.
Option Compare Database
Option Explicit
Dim db As Database
Dim rs As Recordset
Private Sub Form_Load()
Set db = CurrentDb
Set rs = db.OpenRecordset("qry_AddJob")
FillForm
End Sub
Private Sub FillForm()
If Not rs.BOF And Not rs.EOF Then
Me.txtStorage = rs!StorageDate
Me.txtUnit = rs!TypeCargoID
Me.txtVessel = rs!VesselID
Me.txtCargoDescription = rs!CargoDescription
End If
Private Sub btnSave_Click()
' On Error Resume Next
rs.Edit
rs!StorageDate = Me.txtStorage
rs!TypeCargoID = Me.txtUnit
rs!CargoDescription = Me.txtCargoDescription
rs!VesselID = txtVessel
rs.Update
End Sub
End Sub