Updating combo boxes with new records


S

Sue Peirce

Hi,

From a seminar event booking form (main form - event
details, subform - students booked onto it) I'm trying to
sort out a pop-up form to add the records required for a
new student before booking that student onto the seminar
event. (Some bookings will be for students that already
exist on the database and for others I want to create the
bare bones information to allow the booking to be made,
other details will be added after the student attends.)

I know that my pop-up form is creating the records on
the 'Person' and 'Enrolment' tables but when I close the
pop-up and try to refresh the booking form so that the
student's name appears in the subform I get an error
message. The personID autonumber field is used for a
multiple-field combo box so that the student's name
appears (PersonID is the invisible first, bound column of
the combo box). The message says that there's no record in
the Person table with 'key matching fields ", " '.

How do I update the combo box value with the PersonID and
get it to display the name information correctly. I've
tried various combinations of form/subform 'refresh' and
form/combo box 'requery'. I use the following to save the
records before doing this:

"DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70"

Thanks
Sue
 
Ad

Advertisements

L

Lee T.

-----Sue Wrote:-----
Hi,

From a seminar event booking form (main form - event
details, subform - students booked onto it) I'm trying to
sort out a pop-up form to add the records required for a
new student before booking that student onto the seminar
event. (Some bookings will be for students that already
exist on the database and for others I want to create the
bare bones information to allow the booking to be made,
other details will be added after the student attends.)

I know that my pop-up form is creating the records on
the 'Person' and 'Enrolment' tables but when I close the
pop-up and try to refresh the booking form so that the
student's name appears in the subform I get an error
message. The personID autonumber field is used for a
multiple-field combo box so that the student's name
appears (PersonID is the invisible first, bound column of
the combo box). The message says that there's no record in
the Person table with 'key matching fields ", " '.

How do I update the combo box value with the PersonID and
get it to display the name information correctly. I've
tried various combinations of form/subform 'refresh' and
form/combo box 'requery'. I use the following to save the
records before doing this:

"DoCmd.DoMenuItem acFormBar, acRecordsMenu,
acSaveRecord, , acMenuVer70"

Thanks
Sue
..

Sue,

I have a form with data about a "case" and a subform
with individuals assigned to that "case". On the subform
I pop open a form to edit or add new folks assigned to
that "case". The way I get the new person assigned to
that "case" when I am done with my popup entry form is to
put the following in the ON EXIT event for the popup form.

Forms!<MainForm>.Refresh

That way all the data refreshes, both the main form
and the subform.

If this is not what you are looking for, send me a
mail if you wish.

hth

Lee T.
[email protected] hotmail
 

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

Top