Notinlist event

G

Guest

Here's my problem, I have the combo box set up for the notinlist and that is
working just great. I can bring up the add new form and be able to enter all
the data that's required. Now here is where I get lost, when I exit the add
new form and come back to the original screen I would like to have all the
data I entered into the new form populate the form I'm returning to. Here's
the senario I'm registering a person for a class, the combo box shows all the
people in my database I enter the persons id number, the person isn't in the
database, so I get the notinlist event which brings up the new persons screen
with address city etc. How do I get that information back to the
registration form? I hope someone can understand this and give me some help.
Thanks
 
G

Guest

Howdy, parnder!

Assuming the Add New form you are entering the data in is putting the data
in the same table that is the record source of the form you are working with,
you will have to get the data just entered in the Add New into the currnet
form's record source. That will require a Requery. Then you have to
navigate to the new record.

I am also assuming the value entered in the combo is the primary key of the
underlying table. That value, then will be the value in the NewData argument
of the NotInList event.

Now it becomes almost the same as using a combo box as a search control.
You look up the primary key and move to that record:

'This would be after you return from the Add New form (which, to make this
work needs to be modal so the code will pause until you close the Add New
form.

Me.Requery
With Me.RecordsetClone
.FindFirst "[PrimaryKeyField] = " & NewData
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With

This is, of course, untested "air code", CD, but the basic idea should get
you through it.

BTW, Cobb is getting married (again) in a couple of weeks.
 

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


Top