Saving combo box value in same table field

G

Guest

Hi

I have a form that looks like this:

Employment number (Comes from a table called Employment)
Name (comes from a table called employment)
Course 1 (combo box where selectied values comes from a table named Courses)
Course 2 (combo box where selectied values comes from a table named Courses)
Course 3 (combo box where selectied values comes from a table named Courses)

In the table employment I have a field called courses. I want the three
combo boxes to write the values selected in the box, to the same field
"courses".

Fx.
If there is a value selected in combo box 2, in should dublicate the row for
that employment number and write the value selected in combo box 2 in field
"Courses". If there is a value selected in combo box 3, it should dublicate
the row for that employment number and write the value selected in combo box
3 in field "Courses". and so on.

The table should in the end look some what like this

Employment number Name courses
1 Johan metal (Course selected in
combobox 1)
1 Johan access (Course selected in
combobox 2)
2 Lis "Emty if no
courses selected that employment number"

Please help me. Thank you.
 
J

John W. Vinson

Hi

I have a form that looks like this:

Employment number (Comes from a table called Employment)
Name (comes from a table called employment)
Course 1 (combo box where selectied values comes from a table named Courses)
Course 2 (combo box where selectied values comes from a table named Courses)
Course 3 (combo box where selectied values comes from a table named Courses)
In the table employment I have a field called courses. I want the three
combo boxes to write the values selected in the box, to the same field
"courses".
Fx.
If there is a value selected in combo box 2, in should dublicate the row for
that employment number and write the value selected in combo box 2 in field
"Courses". If there is a value selected in combo box 3, it should dublicate
the row for that employment number and write the value selected in combo box
3 in field "Courses". and so on.

The table should in the end look some what like this

Employment number Name courses
1 Johan metal (Course selected in
combobox 1)
1 Johan access (Course selected in
combobox 2)
2 Lis "Emty if no
courses selected that employment number"

Please help me. Thank you.

If you're trying to store three courses in one field, that's a bit
like storing three gallons of milk in one gallon jug. IT WON'T WORK.

Forms are *just windows*. You don't "store" a combo box! You *use* a
combo box to store data into a field (one item of data into one
field!) in a Table.

If each Employee can take multiple Courses, and each Course can be
taken by multiple Employees, then you *need another table*. The
Employment table should not have a Courses field at all.

Instead you would have a EmployeeCourses table with fields for the
unique EmployeeID (you should certainly not be using Name; names
aren't unique, Name is a reserved word, and other problems) and the
CourseID or course name. This table would be edited using a Subform on
the Employment form, using the EmployeeID as the master/child link
field, and it would contain just one combo box to select the course.
Each course would be in a new record in this table.

John W. Vinson [MVP]
 

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