Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format datain a combo-box

Status
Not open for further replies.

Tusk

Technical User
Oct 21, 2002
48
0
0
GB
Hi All,

I have a combo-box on an orders form that returns customer name and address data from a linked query. The combo-box returns the correct data but I want to be able to format the output so that the name and address appear on different lines in the combo-box. Is there an easy way to do this?

Regards

Tusk
 
How are ya Tusk . . .

A custom field in the query of the combo should do:
Code:
[blue]FullComp:[CustFieldName] & Chr(13) & Chr(10) & [AdrFieldName][/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
The method suggested by TheAceman1 will not display more than one line when dropped down. Once a value has been selected, the combo box will display more than one line if the combo box height allows it.

You could use an extra column to display the fields side-by-side:
Code:
SELECT CustomerID, [CustFieldName] & Chr(13) & Chr(10) & [AdrFieldName],[AdrFieldName]
FROM tblCustomers
ORDER BY [CustFieldName];
Column Count: 3
Column Widths: 0,1,1
Bound Column: 1
Height: 0.3"
Font Size: 8


Duane
Hook'D on Access
MS Access MVP
 
Tusk . . .

Although the data is properly formatted for two lines, there's no way (I've found yet) to increase the line width of the combo to 2. Leaving a view problem!

Will advise if I find anything ...

BTW: is it so bad to have the name an address side by side?

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Tusk . . .

Possible solution here: Increase listbox row height and wrap text. Only you have to try the 30-day free trial membership to view it.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks both, will try and see what happens :)

"BTW: is it so bad to have the name an address side by side?" Well yes in this case it is, space is limited and it's what the client wants :)

Cheers for the assist so far.

Tusk
 
Doesn't look so bad really, client is happy to go with it for now.

Cheers guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top