Combo box row height?

T

Terry

I have a cbo box that I use to choose addresses for customers that own
rental property.

Some of the addresses have two lines, like

111 somewhere
apt12


Is the a way I can get the cbo dropdown to show both lines?
 
D

Dirk Goldgar

Terry said:
I have a cbo box that I use to choose addresses for customers that own
rental property.

Some of the addresses have two lines, like

111 somewhere
apt12


Is the a way I can get the cbo dropdown to show both lines?


Not with the native Access combo box. There may be a third-party control
that could do it, but I don't know of one.

What you could do is give your combo box a rowsource query that transforms
the address from two lines to one line that includes both the original
lines. I think you could use the Replace function to do this, replacing the
character sequence Chr(13) & Chr(10) with some other character(s) such as "
/ ". For example, your combo's rowsource could be something like this:

SELECT ID, Replace(Address, (13) & Chr(10), " / ") As Address2
FROM Addresses;
 
A

Arvin Meyer [MVP]

Not directly, but you can add a text box and set it equal to the column in
the combo like:

= cboAddresses.Column(1)

for the second column. You can also use the zoom box with either the
keyboard Shift+F2 or VBA code:

Sub cboAddresses_DblClick()
DoCmd.RunCmd acCmdZoomBox
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top