Multi List box in form

  • Thread starter spcscooter via AccessMonster.com
  • Start date
S

spcscooter via AccessMonster.com

I have created a multi list box where I can select multiple employees to
attend a training class. The only problem is that when I click on an
employee and save the record it doesn't populate to the table that I have
created for course enrollment.

The table and form go something like this.

Course Enrollment Table

ID = PK
CourseName = lookup
 
S

spcscooter via AccessMonster.com

I have created a multi list box where I can select multiple employees to
attend a training class. The only problem is that when I click on an
employee and save the record it doesn't populate to the table that I have
created for course enrollment.

The table and form go something like this.

Course Enrollment Table

ID = PK
CourseName = lookup
TrainingDate
Attendee = lookup
Instructor1 = lookup
Instructor2 = lookup
Hours
TrainingLocation = lookup

Course Enrollment Form

ID = PK
CourseName = lookup
TrainingDate
Attendee = MultiList box
Instructor1 = lookup
Instructor2 = lookup
Hours
TrainingLocation = lookup

I am very new to this process and don't know code very well. I think I know
enough to start but I don't know what to do next.

Thanks for all your help
 
K

ken

To use a multiselect list box for data entry you'd have to write code
to update the table when inserting or editing data, and to select
items in the list box when viewing existing data. List boxes are not
really intended for this purpose and there is a far simpler way of
doing it:

Create a form in single form view based on your Courses table. Then
create a form in continuous form view based on your Course Enrolment
table, but don't include a control bound to the CourseName field in
it. Then embed the enrolment form in the courses form as a subform
linking it to the parent form on whatever are the primary and foreign
key fields by which the tables are related, presumably CourseName.

Its then simply a matter of inserting a new row in the subform for
each attendee at the parent form's current course.

Ken Sheridan
Stafford, England
 
S

spcscooter via AccessMonster.com

sorry to sound so ignorant but I am not sure what you are referring to as a
single form view and a continuous form view. I have always relied on wizards
to most of my databases, so you can see what I am limited to. I do know how
to do sub forms however. :) If I am asking too much can you refer to a site
or book where I can have examples of what I need to do. Sorry to be a pain.

To use a multiselect list box for data entry you'd have to write code
to update the table when inserting or editing data, and to select
items in the list box when viewing existing data. List boxes are not
really intended for this purpose and there is a far simpler way of
doing it:

Create a form in single form view based on your Courses table. Then
create a form in continuous form view based on your Course Enrolment
table, but don't include a control bound to the CourseName field in
it. Then embed the enrolment form in the courses form as a subform
linking it to the parent form on whatever are the primary and foreign
key fields by which the tables are related, presumably CourseName.

Its then simply a matter of inserting a new row in the subform for
each attendee at the parent form's current course.

Ken Sheridan
Stafford, England

I have created a multi list box where I can select multiple employees to
attend a training class. The only problem is that when I click on an
[quoted text clipped - 37 lines]
Message posted viahttp://www.accessmonster.com
 
K

ken

Single Form View is when the form shows one record at a time,
Continuous Forms View is when it shows multiple records, usually with
each on pone row. A form can only contain a subform if the former is
in single form view, but the latter can be in continuous forms view,
single form view or datasheet view. I'd recommend using continuous
forms view rather than datasheet view, however. The former gives you
much more scope for formatting and you can include unbound controls
such as buttons or navigational controls in its header or footer,
whereas datasheet view, while easy to set up does not present a very
professional image and is much more limiting as regards formatting.

To set a form in single or continuous form view set its DefaultView
property in its properties sheet while in design view.

In your case I'm suggesting that the parent form be in single form
view, so it will show one course at a time, and that the subform be
in continuous forms view so it will show all attendees at the
currently selected course in the parent form simultaneously in rows.
You can then add or delete attendees from the course simply by
inserting or deleting a new row in the subform.

For an example take a look at the categories form in the sample
Northwind database. You'll see that it has a subform which shows all
products for the currently selected category in the parent form.

Ken Sheridan
Stafford, England

sorry to sound so ignorant but I am not sure what you are referring to as a
single form view and a continuous form view. I have always relied on wizards
to most of my databases, so you can see what I am limited to. I do know how
to do sub forms however. :) If I am asking too much can you refer to a site
or book where I can have examples of what I need to do. Sorry to be a pain.



To use a multiselect list box for data entry you'd have to write code
to update the table when inserting or editing data, and to select
items in the list box when viewing existing data. List boxes are not
really intended for this purpose and there is a far simpler way of
doing it:
Create a form in single form view based on your Courses table. Then
create a form in continuous form view based on your Course Enrolment
table, but don't include a control bound to the CourseName field in
it. Then embed the enrolment form in the courses form as a subform
linking it to the parent form on whatever are the primary and foreign
key fields by which the tables are related, presumably CourseName.
Its then simply a matter of inserting a new row in the subform for
each attendee at the parent form's current course.
Ken Sheridan
Stafford, England
I have created a multi list box where I can select multiple employees to
attend a training class. The only problem is that when I click on an
[quoted text clipped - 37 lines]
Message posted viahttp://www.accessmonster.com

--
Scot Rawlings
Technical Trainer
Comcast
Auburn, WA

http://www.accessmonster.com/Uwe/Forums.aspx/access-gettingstarted/20...
 
B

Becky Smith-Miles

I don't know how to join the group to get help on ANYTHING...no box to pic
to register to the group
 

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