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
 
Back
Top