hi,
i get a variable undefined error highlighting the top row of my code - can ne1 see why?
i get a variable undefined error highlighting the top row of my code - can ne1 see why?
Code:
Private Sub taskcombo_NotInList(NewData As String, Response As Integer)
Dim Db As DAO.Database
Dim Rs As DAO.Recordset
DoCmd.SetWarnings (warningsoff)
If MsgBox("OK to add new Task type.?. Or Press Cancel to Discard", vbOKCancel + vbwarning, "Add Equip Type?") = vbOK Then
Set Db = CurrentDb
Set Rs = Db.OpenRecordset("tbl_task", dbOpenDynaset)
' On Error Resume Next
Rs.AddNew
Rs![task] = NewData
Rs.Update
Set Db = Nothing
' Continue without displaying default error message.
Response = acDataErrAdded
Else
DoCmd.SetWarnings (warningsoff)
Response = acDataErrContinue
Me.Undo
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
Me!taskcombo.Requery
End If
End Sub