Function NIL(NewData As String) As Integer
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim stControlName As String
Dim stLabelName As String
stControlName = Screen.ActiveControl.Name
stLabelName = Me.txtLabelName
If Eval("Msgbox('The " & stLabelName & " ''" & NewData & "'', Is Not On The " & stLabelName & " List!@Would you like me to " & _
"add ''" & NewData & "'' to the current " & stLabelName & " List?" & _
"@@',4,'AMC Database System Error Message')") = vbNo Then
Me.cboChair.Undo
NIL = acDataErrContinue
Exit Function
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("Component", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!Component = NewData
rs!DiscrpID = Me.txtDiscripID
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
NIL = acDataErrContinue
Else
NIL = acDataErrAdded
rs.Close
Set rs = Nothing
Set db = Nothing
End If
End If
End Function
Function ftxtFill()
Dim strControlName As String
strControlName = Screen.ActiveControl.Name
Me.txtDiscripID = Mid(Forms.Tag, InStr(Forms.Tag, " ") + 1)
Me.txtLabelName = Left(Forms.Tag, InStr(Forms.Tag, " "))
End Function
Private Sub cboColor_NotInList(NewData As String, Response As Integer)
Response = NIL(NewData)
End Sub