Combo box values

F

Fie

Right i have a combo box with 3 column's

1. School
2. No Pupils
3. Cost center

when a user selects one of the rows say i.e Newmill; 212 (pupils); 1888
(cost center)
it only seems to display the school name in the actual table, but in my
table i have fields
called School (this is where it stores the school name, which it does),
No Pupil's & Cost Center.

How do i get the values from the combo box to store in each of these
fields????
 
G

Guest

On the after update event of the combo, write the code

Me.[No Pupils text field] = Me.[Combo name].column(1)
Me.[Cost center] = Me.[Combo name].column(2)
=====================================
I assume that you want to store the value right to the moment when it was
selected.
If, for example, you make changes to the Cost center field, it wont change
the value you stored in the table, if you want the changes to reflect in the
main table, then you shouldn't store this values in the table.

You can write in the control source of the field in the form
No Pupils
=[Combo name].column(1)
Cost center
[Combo name].column(2)
 

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