not in list - same form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a combo box that looks up data in the underlying table and populates
the other text boxes. I would like to use the "notinlist" property to add new
records by going to the end of the data entry form and have the user to input
the info.

The form with the combo is the data entry form.
Thanks
 
JJ said:
I have a combo box that looks up data in the underlying table and populates
the other text boxes. I would like to use the "notinlist" property to add new
records by going to the end of the data entry form and have the user to input
the info.


A minimal NotInList event:

DoCmd.OpenForm "nameofform", _
WindorMode:= acDialog,
DataMode:= acFormAdd
Response = acDataErrAdded

Once you get that working, you may decide that you want to
elaborate on that, but I suggest that you don't try to get
fancy until you recognize a real need for it.
 
Thanks for the quick response.

I'm not looking to open a form as you have indicated by the DoCmd.Openform

The form I want open is already open, I would like to jump to end of file
and add the new information

something similar to DoCmd.GoToRecord ?????? acNewRecord

Thanks
 
You want to add the new record in the same form as the combo
box?

NotInList can't do that because it must complete before you
can navigate to a different or new record.

Try setting the combo box's LimitToList property to No and
using the combo box's AfterUpdate event to navigate to the
new record:

If Me.thecombo.ListIndex = -1 Then
DoCmd.GoToRecord acForm, Me.Name, acNewRec
End If
 
Back
Top