Discussion Locked

Using Combo boxes to display values in a

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to create a combo box or list box that looks up the values in a table, I want it to display three column, when I select the value I want from the list, three fields will be filled in. For example I have a combo box that displays [course title] [course ID] [course hours] when I select the course title, the course ID and course hours will also get selected and filled in the table.
Course Title Course ID Course Hours
WORKING ALOFT DSC002C 4
WORKPLACE SAFETY DSC002D 2I have only been able to make the first column value get displayed in the table when I select course title. I want all three to be shown in the table

5 replies

by don christner

You can concantenate the three items together like:

combo1.text = 1stField & " " & 2ndField & " " & 3rdField.

Probably better to use a flexgrid. You then have much better control of how the data is displayed.

Convert your fields to text before you display them no matter which way you go.

Don

by richtee

To Display the number of columns you want:
Bring up the properties of the combo box control | Select the Format Tab |

Column Count: This will let you control how many fields will show across in your drop down
Column Heads: This will show the field name ? this toggles on or off.
Column Widths: This allows you to customize the column widths corresponding to the Column Count. Separate the values by a semi-colon. Use zero to hide a column.

I am sure if you play around with this you will get what you want to display.

Using the combo box usually defaults to calling or returning only the value of the First or Primary Key field from the table it is based on. You could use this field to set up a relationship from the Course Table to the table where the new record set will go.

There is more than one way to go with this. Difficult to suggest what could be done without more information. Hope this helps you get there.

Good Luck.
Rich

This discussion is closed to new replies.