Combo Box

Helping Hand
NewLounger
Posts: 13
Joined: 13 Mar 2014, 09:56

Combo Box

Post by Helping Hand »

Is there a way to show more than one field in the results of a combo box?

I'm using a table as a pick list. [tblActivityLocations].[FieldID] is used to update [frm4_Activity].[FieldID]. The combo box hides the [FieldID] and shows [Name]. Ideally, I would like to see [tblActivityLocations].[Location], [tblActivityLocations].[StartTime], [tblActivityLocations].[EndTime] and [tblActivityLocations].[Day] in the combo box. Is that possible?

This is what is in the properties for the Row Source on the combo box.
SELECT [tblActivityLocations].[FieldID], [tblActivityLocations].[Name], [tblActivityLocations].[Location], [tblActivityLocations].[LocationType], [tblActivityLocations].[StartTime], [tblActivityLocations].[EndTime], [tblActivityLocations].[Day] FROM tblActivityLocations;

Is there anything else that you can recommend if a combo box can only show one field? For that matter, feel free to offer something else if I'm going about this all wrong and a combo box is not the way to go! lol

Thank you.

User avatar
HansV
Administrator
Posts: 78577
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Combo Box

Post by HansV »

If you set the Column Count property of a combo box to a number greater than 1, the dropdown list part of the combo box can display the specified number of columns (how exactly is controlled by the Column Widths property). But the text box part of the combo box will always show one column only - the first column whose column width is greater than 0.

If you want to display multiple columns all the time, use a list box instead of a combo box. The column display is again controlled by the Column Count and Column Widths properties.
Best wishes,
Hans

Helping Hand
NewLounger
Posts: 13
Joined: 13 Mar 2014, 09:56

Re: Combo Box

Post by Helping Hand »

I see the fieldID in the listbox.

Oops! The default view on the form was set to datasheet. The list box will work well - thank you!