F
forest8
Hi there
I currently have this code in my database but I can't seem to make it work
(i.e. no new names are added to my combo box). I don't think I have attached
the event procedure properyly either. Where should I put it?
Private Sub Coach_NotInList(NewData As String, Response As Integer)
intAnswer = MsgBox("This coach" & NewData & " is not currently in the list."
& vbCrLf & _
"Would you like to add this coach to the list now?" _
, vbQuestion + vbYesNo, "This coach")
If intAnswer = vbYes Then
strSQL = "INSERT INTO CB_Coach([CB_Coach]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
MsgBox "This coach has been added to the list." _
, vbInformation, "NewData"
Response = acDataErrAdded
Any help will be greatly appreciated. Thank you for your help in advance.
I currently have this code in my database but I can't seem to make it work
(i.e. no new names are added to my combo box). I don't think I have attached
the event procedure properyly either. Where should I put it?
Private Sub Coach_NotInList(NewData As String, Response As Integer)
intAnswer = MsgBox("This coach" & NewData & " is not currently in the list."
& vbCrLf & _
"Would you like to add this coach to the list now?" _
, vbQuestion + vbYesNo, "This coach")
If intAnswer = vbYes Then
strSQL = "INSERT INTO CB_Coach([CB_Coach]) " & _
"VALUES ('" & NewData & "');"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
MsgBox "This coach has been added to the list." _
, vbInformation, "NewData"
Response = acDataErrAdded
Any help will be greatly appreciated. Thank you for your help in advance.