Re: NotinList Event

Tech-Archive recommends: Speed Up your PC by fixing your registry



Sailormike,

Open the form using the acdialog mode like in this code. This will make the
code wait until the user closes the form to continue. You can also pass the
combo entry using the openargs.

Private Sub Combo_NotInList(NewData As String, Response As Integer)
If vbYes = MsgBox("Not In List." & vbCrLf & "Add To List?", vbYesNo +
vbQuestion, "Not In List") Then
DoCmd.OpenForm "puf_AddRecord", , , , , acDialog, NewData
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub

Then, in the form that opens, you can set the value to the openargs value
like this:

Private Sub Form_Open(Cancel As Integer)
If Not 0 = len(Me.OpenArgs) then
Me!Combo = Me.OpenArgs
End If
End Sub

HTH,
Josh

"Sailormike" <Sailormike@xxxxxxx> wrote in message
news:EE47A2EF-4436-44EF-BAF7-DAA6DF106FC2@xxxxxxxxxxxxxxxx
This has got to be a very common problem but i have not found an answer
anywhere?!

When this event occurs I want to pop up a form that allows the user to add
a
record to the table. But a new record requires data in 3 fields not just
the
one in the combo box. I have a form that does this but the NotInList event
does not allow just opening a form.

How do i get this event to just open the form?
--
SailorMike


.



Relevant Pages

  • Re: NotinList Event
    ... tried and couldn't get it to work I did find my error and ur suggestion does, ... Private Sub Combo_NotInList(NewData As String, Response As Integer) ... Then, in the form that opens, you can set the value to the openargs ...
    (microsoft.public.access.formscoding)
  • Re: How To Change default error messages
    ... is it possible to selectively display custom error messages for the ... Private Sub Save_Vehicle_Click(DataErr As Integer, Response As Integer) ... > Response = acDataErrContinue ' Don't display the default message ...
    (microsoft.public.access.forms)
  • RE: Contact Code Issue
    ... form opens with Shrek showing up. ... Fiona has been added in the query. ... Response = acDataErrContinue ...
    (microsoft.public.access.formscoding)
  • RE: Displaying new record not in list
    ... Response As Integer) ... Dim intAnswer As Integer ... Response = acDataErrContinue ... but when the form opens for me to add the new record none of ...
    (microsoft.public.access.formscoding)
  • Re: NotInList, Combo boxes, evil day
    ... Private Sub orgId_NotInList(NewData As String, Response As Integer) ... Dim mbrResponse As VbMsgBoxResult ... Response = acDataErrContinue ...
    (microsoft.public.access.forms)