not in list error message

aqif

Registered User.
Local time
Today, 21:36
Joined
Jul 9, 2001
Messages
158
Hi :)

I have programmed the Not In List Event and when it does not find the values it undo the list value and opens the relative for to add another item id and then it refreshes back the form.

Everything is working fine except I can't get rid of that message.

"the text you entered isn't an item in the list"

I tried setting DoCmd.SetWarnings False and On Error Resume Next stuff but none of the thing is preventing that message to appear. Any things I am missing...? My code for Not in list event looks like this


Dim strResponse As String

strResponse = MsgBox("The Consultant you are trying to enter is not present in the database." & _
"Click YES to input new Consultant", vbYesNo + vbCritical, "Consultant Not Found")

If strResponse = vbYes Then
Me.ConsId.Undo
DoCmd.OpenForm "FrmConsultants", acNormal, , , acFormAdd
Else
MsgBox (acDataErrDisplay)
End If


Cheers!
Aqif
 
Try this one
Private Sub Supplier_NotInList(NewData As String, Response As Integer)
Dim Msg, Style, Title, MyString

Beep
Msg = "You have entered a supplier that has not been recorded do you wish to enter this supplier or remove the entry. Select yes to add supplier, No to cancel entry. "
Style = vbYesNo + vbExclamation + vbDefaultButton1
Title = "No supplier details listed"
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then
DoCmd.RunCommand acCmdUndo
DoCmd.OpenForm "Suppliers", acNormal, , , acAdd, acDialog, NewData

Response = acDataErrAdded
End If
End Sub
 
didn't helped

It didn't helped :( any more suggestions?

Cheers!
Aqif
 
I used
Msgbox "La la la"
Response = acDataErrContinue
Works for me
HTH
Dave
 

Users who are viewing this thread

Back
Top Bottom