Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not In List Message

Status
Not open for further replies.

Aqif

Programmer
Apr 27, 2002
240
AU
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
 
You have to set the LimitToList property to False, otherwise you won't be able to leave the combo box. After running the code, restore the property to True (use whatever event: AfterUpdate, Current and so on) to do it.


If strResponse = vbYes Then
[ComboBoxName].LimitToList = False
Me.ConsId.Undo


Dan
 
Hi

It's still giving me the same error :(

Anything alternative?

Aqif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top