Combo box: Align Columns

irade92

Registered User.
Local time
Today, 21:49
Joined
Dec 26, 2010
Messages
229
Hi
I want some columns in a Combo box to be aligned left, some columns to be aligned center and some to be right aligned. Is there any way to do it.
And instead of False/True in a column to be check box
And is there any way Titles in a Combo box to be different color

Thanks
 
I am sorry to say the answer to all those questions are no.
 
The Merlin of Microsoft, Stephen Lebans, has a sample database on his site at

http://www.lebans.com/customlistboxver3.htm

called CustomListBoxver3 is a database containing functions to simulate a Standard Listbox Control but with data formatting and alignment capabilities.

It does require either VB6 or MS Office Pro to be installed in order to run it, and Stephen's hacks are not for the faint-of-heart, but it will do some of what you want, and with a little modification, maybe all of what you want.

Linq ;0)>
 
Last edited:
@Linq,

The OP asked for a Combo Box... That sample by Master Coder Lebans is for a List Box.
 
Perhaps the concept on the Lebans link can be mated with the Pseudo Drop Down (originally posted by Galaxiom) to do what the OP is looking for?
 

Attachments

All Fields in Comboboxes are considered, by Access, to be Strings/Text, and I expect that this is the reason they're all Left-Aligned. MS Access, like most programs/languages, has limitations and you simply have to learn to work within them.

Linq ;0)>
 
If the program we are using can’t do it directly, we do it ourselves…

Fixed length Font padded with spaces:-

Code:
Private Sub Form_Load()
    Dim strSQL As String

    strSQL = " SELECT String(0, 160) & CompanyName AS [" & String(0, 160) & "Company Name]," & _
             "        String((20 - Len(ContactName))/2, 160) & ContactName AS [" & String((20 - Len("Contact Name")) / 2, 160) & "Contact Name]," & _
             "        String(20 - Len(SomeNumber), 160) & SomeNumber AS [" & String(20 - Len("Some Number"), 160) & "Some Number]" & _
             " FROM tblCustomers" & _
             " ORDER BY CompanyName," & _
             "          ContactName"

    With Me.cboCustomers
        .RowSource = strSQL
        .FontName = "Courier New"
        .FontSize = 8
        .FontWeight = 400
    End With

End Sub

Access 2003 demo attached.

Chris.
 

Attachments

I use the Text Align on the field at the Table Level using Access 2007. There is a property called Text Align, the field is a Long Integer, Format is BLANK, Decimal = 0, Text Align = Right.

Simon
 
Hi Gina.

Just something to do. :)

This one is a sub-form…more bling for the buck.

Edit
Cleanup and more bling added.

Chris.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom