Hi: I need help with the below procedure:
Private Sub Ctl40OTHours_AfterUpdate()
On Error GoTo Err_Ctl40OTHours_AfterUpdate
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "INSERT INTO NameHours ( ID, " _
& "Cost) " _
& "VALUES ('" & Forms("OVER-TIME TRACKING FORM").[frmTotalCost].Form.[ID] & "', " _
& "#" & Forms("OVER-TIME TRACKING FORM").[frmTotalCost].Form.[Cost] & "#); "
db.Execute strSQL, dbFailOnError
Set db = Nothing
exit_Ctl40OTHours:
Exit Sub
Err_Ctl40OTHours_AfterUpdate:
MsgBox Err.Description
Resume exit_Ctl40OTHours
End Sub
I am getting an error message as : microsoft office access can't find the field 'I ' referred to in your expression
Private Sub Ctl40OTHours_AfterUpdate()
On Error GoTo Err_Ctl40OTHours_AfterUpdate
Dim db As DAO.Database
Dim strSQL As String
Set db = CurrentDb
strSQL = "INSERT INTO NameHours ( ID, " _
& "Cost) " _
& "VALUES ('" & Forms("OVER-TIME TRACKING FORM").[frmTotalCost].Form.[ID] & "', " _
& "#" & Forms("OVER-TIME TRACKING FORM").[frmTotalCost].Form.[Cost] & "#); "
db.Execute strSQL, dbFailOnError
Set db = Nothing
exit_Ctl40OTHours:
Exit Sub
Err_Ctl40OTHours_AfterUpdate:
MsgBox Err.Description
Resume exit_Ctl40OTHours
End Sub
I am getting an error message as : microsoft office access can't find the field 'I ' referred to in your expression