Selection from combo box will fill related fields in text box

G

Guest

I have a class table and in my registration form I want to create a combo box
of the class ID which will automatically filed the other text box with class
cost, class time etc.
 
R

Ron2006

I have a class table and in my registration form I want to create a combo box
of the class ID which will automatically filed the other text box with class
cost, class time etc.

For the query on your combox include all of the fields you mention.

In the afterupdate event for the comb box add the following type of
code

me.classname = me.comboboxname.column(n1)
me.classtimename = me.comboboxname.column(n2)
etc for all the fields that are to be loaded.

If the fields are only display fields as opposed to bound fields, then
you will also need to put the above code in the oncurrent event of the
form.

n1 and n2 are the colmun numbers of the appropriate field relative to
0 (first field use 0 as number, second field use 1 as the number,
etc)

In the number of columns property of the combo put how many columns,
supply the length for each of the fields in the field lengths. To hide
the field from the dropdown use a length of 0. The first field that
has a length >0 will be the field that shows in the combobox. The
bound column is the value that will be saved in the field if it is
bound to a table field.

Ron
 

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