Selecting multiple information from a combo

deejay_totoro

Registered User.
Local time
Today, 17:16
Joined
May 29, 2003
Messages
169
Hello all,

I have a little problem!

I have inserted a combo box into my main form.

This combo box looks to a table as its source. (By the way, the source is an excel file.)

The source table contains 3 columns:

Surname
Firstname
Grade

Now, the problem is I would like all 3 fields to be recorded into a field on my main form. But, the wizard will only give me the choice of storing the information from one of the columns.

Is there anyway I can store all 3 columns of information in a single (separate) field?

So from the combo menu it might look like:

|Surname|Firstname|Grade|

which when clicked would supply another field with all the information, so it can be stored in a single field.

Any ideas?

Thanks very much.

dj_t

PS: There may also be occasions where I would like to store the information from the combo box into 3 separate fields. Is that also possible?
 
If you base your combo box on a query from your main table, you can add a calculated field to your query:

FullName: Surname & " " & FirstName & " " & Grade.

When the query is run to produce the rows for your combi, it will put all the fields into one string, just as you want it. The other separate fields will also be output from the query, of course


If you want to display the combined field in your combo box, you must make it the first visible column. (Usually, the first column is the primary key and it is hidden by making the column width property =0. ) If this is the case, make the calculated FullName field the second field in the query and adjust its column width in the combo's property sheet so you can see the full details.

The Number of columns should be 5. (PK, FullName, Surname, FirstName, Grade).


When you click on the combo, the full name will be displayed. Whether you need to store this in a separate field can be discussed.

The separate fields can be referenced by their Column should you need them. But let's make sure we have understood the process so far!
 

Users who are viewing this thread

Back
Top Bottom