Hi!
I've had the code below work beautifully until we upgraded to Office XP, now I can't seem to suppress the standard Access message "The text you entered, blah, blah, blah." I copied it exactly from a previous form, but now it doesn't work. Does anyone know if "acDataErrContinue" and "acDataErrAdded" still works in Access 2002, or has it been replaced with something else? This has been driving me nuts!
Thanks in advance!
JayeD
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams
I've had the code below work beautifully until we upgraded to Office XP, now I can't seem to suppress the standard Access message "The text you entered, blah, blah, blah." I copied it exactly from a previous form, but now it doesn't work. Does anyone know if "acDataErrContinue" and "acDataErrAdded" still works in Access 2002, or has it been replaced with something else? This has been driving me nuts!
Code:
Private Sub School_NotInList(NewData As String, Response As Integer)
On Error GoTo Err_School_NotInList
Dim db As Database
If MsgBox("School or building is not on the list." & vbCr & " Would you like to add it?", _
vbYesNo Or vbQuestion, "Unknown School or Building Name") = vbYes Then
Set db = CurrentDb()
db.Execute "INSERT INTO DistrictInfo (School) Values ('" & NewData & "');"
Set db = Nothing
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
Exit_School_NotInList:
Exit Sub
Err_School_NotInList:
MsgBox Err.Number & "" & Err.Description, vbInformation, "Not in list"
Resume Exit_School_NotInList
End Sub
Thanks in advance!
![[bugeyed] [bugeyed] [bugeyed]](/data/assets/smilies/bugeyed.gif)
"I'm sure of two things: there IS a God, and I'm NOT Him!" - R. Williams