On Not In List

  • Thread starter Thread starter GGG
  • Start date Start date
G

GGG

The following code does not work in the not in list event.
on error goto 1
Response = acDataErrContinue
If MsgBox("Did you want to add a new record? If so, you will need to
click the" _
& "New Record (ctl+E together) to start entering in the info",
vbYesNo) = vbOK Then

Response = acDataErrAdded
ENR.SetFocus
End If
Exit Sub
1:

MsgBox Err.Description & "w/" & Err.Number & " is the problem."
Response = acDataErrContinue
End Sub

What happens is that the msgbox will come across like it should, then,
I"ll say yes.
It never gets to the next command, access will just repeat the msgbox
question again. and if I answer, "no", the canned error shows up (the
microsoft not in list error)
Do I need some sort of warnings off process in order for the next
command, ENR.setfocus to fire?

Dobs
 
GGG,

First problem is that you're setting your response too early. It should be
positioned somewhere after your Message Box.
Secondly, you'll either need to use an append query, pop open a form in
Dialog mode for input, or you'll have to open a recordset to get the data
into the table before you set your response to acDataErrAdded.

Roger Carlson has two sample files dealing with Not In List. Follow the
hyperlink:
http://www.rogersaccesslibrary.com/TableOfContents3.asp#N

HTH,
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

NotInList not firing ? 1
Not in list warning 2
Rename Message Box 3
Not In List 2 values 5
Not in list warning 1
Not in list requery issue 4
Not In List requery & error message on Cancel Add 8
not in list 1

Back
Top