Help with multi column combo box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I display both columns in a combo box once a record is selected. My
ColumnCount is set to 2, and ColumnWidth is 1";1". The drop down displays
both columns fine, but when you select a record, it then only displays the
1st column.

Help is greatly appreciated!
 
Add a text box with Control Source of:
=[Combo0].Column(1)
where Combo0 represents the name of your combo.

Either that, or change the RowSource to concatenate the 2 fields, e.g.:
SELECT Trim([FirstName] & " " & [Surname]) AS FullName
FROM [tblClient] ORDER BY [FirstName], [Surname];
 
Thanks for the help! I have tried both methods, and from a cleaner
appearance standpoint, I'd prefer the concatenated solution. I am assuming
that this won't affect linking Master or Child fields to my subforms.

The first field of my concatenation, [JobNumber], requires an input mask of
##-####, or it displays as ######. When the combo box had just the one field
displayed, it responded to the Input Mask, but it does not in the
concatenated control. How can I get it to recognize this arrangement?

As an example, the JobNumber may be 06-5802. It reads that way in the
table, but not in the form.

Thanks again!

Allen Browne said:
Add a text box with Control Source of:
=[Combo0].Column(1)
where Combo0 represents the name of your combo.

Either that, or change the RowSource to concatenate the 2 fields, e.g.:
SELECT Trim([FirstName] & " " & [Surname]) AS FullName
FROM [tblClient] ORDER BY [FirstName], [Surname];

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kevin said:
How do I display both columns in a combo box once a record is selected.
My
ColumnCount is set to 2, and ColumnWidth is 1";1". The drop down displays
both columns fine, but when you select a record, it then only displays the
1st column.

Help is greatly appreciated!
 
SELECT Format([JobNumber], "00\-0000") & " " & Field2 FROM MyTable

Unless you've got a concatenated field on your subform, it probably will
impact your link fields.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Kevin said:
Thanks for the help! I have tried both methods, and from a cleaner
appearance standpoint, I'd prefer the concatenated solution. I am assuming
that this won't affect linking Master or Child fields to my subforms.

The first field of my concatenation, [JobNumber], requires an input mask of
##-####, or it displays as ######. When the combo box had just the one field
displayed, it responded to the Input Mask, but it does not in the
concatenated control. How can I get it to recognize this arrangement?

As an example, the JobNumber may be 06-5802. It reads that way in the
table, but not in the form.

Thanks again!

Allen Browne said:
Add a text box with Control Source of:
=[Combo0].Column(1)
where Combo0 represents the name of your combo.

Either that, or change the RowSource to concatenate the 2 fields, e.g.:
SELECT Trim([FirstName] & " " & [Surname]) AS FullName
FROM [tblClient] ORDER BY [FirstName], [Surname];

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Kevin said:
How do I display both columns in a combo box once a record is selected.
My
ColumnCount is set to 2, and ColumnWidth is 1";1". The drop down displays
both columns fine, but when you select a record, it then only displays the
1st column.

Help is greatly appreciated!
 
Back
Top