ComboBox Display

hkimpact

Registered User.
Local time
Today, 02:04
Joined
Apr 27, 2012
Messages
51
I currently have a form with 2 combo boxes on it. One combo box has a list of participants that is pulled from a participant table. The other combo box are referrals, which a participant can have many of.

When you have both combo boxes selected there is a "Report" button that displays the appropriate report. Everything works as intended, but I am having a problem with the display problem of the 2nd combo box.

The query of the 2nd combobox has 4 fields (ParticipantID, RSID, Name, Date). The Criteria of the ParticipantID is what determines what records to display in this combobox. My question though is, right now when you click the Referral you want in the 2nd combo box (example: 10 Rick Armstrong 5/11/2012) , After selection it puts only the RSID in the combobox to display. How can I fix this to display everything you selected, but still use the RSID to get the appropriate record.

Thank you in advance,
Rick
 
The bound column is what Access will use from the combo box, so in your case the RSID is the bound column. What is displayed after a selection is made is governed by the Column Widths property. The Column Widths property usually shows a list of widths similar to this: 1";2";0.5" etc (units of measure can vary depending on your local computer settings) that correspond to the columns/fields of the combo box's row source (i.e. your: ParticipantID, RSID, Name, Date)

The value that is displayed after a selection is made is the first column with a non-zero width. So to display only the Name, you would set the column widths to the following: 0";"0";1.5";0"

Now if you want to "display everything", everything has to be in 1 column/field. To do that you will need a query and bind the combo box to that query instead of the table. You will still need the RSID in its own column. Perhaps a query like this:


SELECT RSID, RSID & " " & [Name] & " " & [Date] as DetailedInfo
FROM tablename

By the way, the words Name and Date are reserved words in Access so they should not be used as table or field names. Here is a link to the complete list of reserved words & symbols.
 
For clarity, how are the 2 combo boxes related.
For example, if you select X in the first combo, does that identify what should be available for selection in the second combo?
If so, these are called Cascading Combos. You can find info for these via google.
 
Thank you for both of your responses. I will look more into what both of you have posted.

@jzwp22

Ya I figured something like that. I'll give what you said a shot. I know those are reserved words too, I just didn't type them here with the actual names RSDate, etc.. haha.

@jdraw

I'll look more into Cascading Combos too. That is exactly how mine is set up.

But thank you to you both.
 

Users who are viewing this thread

Back
Top Bottom