Can I align columns in a combo box?

  • Thread starter Thread starter Bob Howard
  • Start date Start date
B

Bob Howard

I have a combo box with three columns showing. The first two are text , and
the final column is a currency amount. The first two columns display
left-aligned, which is fine. But the third column also is left-aligned,
which looks very odd on the screen.

Is there any way to make that currency column display right-aligned?

Thanks in advance!

Bob (@Martureo.Org)
 
Bob,

Nope. Sorry, there's no way to do that in a standard Access combo. You could
search the web for third party combo's which may.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Thanks! I'll give that a try....

Graham R Seach said:
Bob,

Nope. Sorry, there's no way to do that in a standard Access combo. You could
search the web for third party combo's which may.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Bob,

Yes, here is how I have done it. in the Row Source for the combo, I wrap a
function around the numeric column:

SELECT [Actual_res_export].[Activity], [Actual_res_export].[BillCat],
FormatCombo([Actual_res_export].[Jan]) FROM [Actual_res_export]

Then, I have a function that puts spaces on the left of the string to get it
right justified. The number of spaces you need will depend on how wide you
set your column width.

Function FormatCombo(strVal As String) As String
strVal = Format(strVal, "#,##0.0")
FormatCombo = Space(10 - Len(strVal)) & strVal
End Function
 
I like it! I found an item via google, but I like your approach as it's way
simpler. I need something "close" but not 100% perfect ... I'll give it a
try later today and report back.... Thanks!

Bob (@Martureo.Org)

Klatuu said:
Bob,

Yes, here is how I have done it. in the Row Source for the combo, I wrap a
function around the numeric column:

SELECT [Actual_res_export].[Activity], [Actual_res_export].[BillCat],
FormatCombo([Actual_res_export].[Jan]) FROM [Actual_res_export]

Then, I have a function that puts spaces on the left of the string to get it
right justified. The number of spaces you need will depend on how wide you
set your column width.

Function FormatCombo(strVal As String) As String
strVal = Format(strVal, "#,##0.0")
FormatCombo = Space(10 - Len(strVal)) & strVal
End Function


Bob Howard said:
I have a combo box with three columns showing. The first two are text , and
the final column is a currency amount. The first two columns display
left-aligned, which is fine. But the third column also is left-aligned,
which looks very odd on the screen.

Is there any way to make that currency column display right-aligned?

Thanks in advance!

Bob (@Martureo.Org)
 
Nice! Best use a proportional font though.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Klatuu said:
Bob,

Yes, here is how I have done it. in the Row Source for the combo, I wrap
a
function around the numeric column:

SELECT [Actual_res_export].[Activity], [Actual_res_export].[BillCat],
FormatCombo([Actual_res_export].[Jan]) FROM [Actual_res_export]

Then, I have a function that puts spaces on the left of the string to get
it
right justified. The number of spaces you need will depend on how wide
you
set your column width.

Function FormatCombo(strVal As String) As String
strVal = Format(strVal, "#,##0.0")
FormatCombo = Space(10 - Len(strVal)) & strVal
End Function


Bob Howard said:
I have a combo box with three columns showing. The first two are text ,
and
the final column is a currency amount. The first two columns display
left-aligned, which is fine. But the third column also is left-aligned,
which looks very odd on the screen.

Is there any way to make that currency column display right-aligned?

Thanks in advance!

Bob (@Martureo.Org)
 
Good point! I globally use Tahoma, so I may need to vary that for this one
control (I still like the approach). Bob.

Graham R Seach said:
Nice! Best use a proportional font though.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------

Klatuu said:
Bob,

Yes, here is how I have done it. in the Row Source for the combo, I wrap
a
function around the numeric column:

SELECT [Actual_res_export].[Activity], [Actual_res_export].[BillCat],
FormatCombo([Actual_res_export].[Jan]) FROM [Actual_res_export]

Then, I have a function that puts spaces on the left of the string to get
it
right justified. The number of spaces you need will depend on how wide
you
set your column width.

Function FormatCombo(strVal As String) As String
strVal = Format(strVal, "#,##0.0")
FormatCombo = Space(10 - Len(strVal)) & strVal
End Function


Bob Howard said:
I have a combo box with three columns showing. The first two are text ,
and
the final column is a currency amount. The first two columns display
left-aligned, which is fine. But the third column also is left-aligned,
which looks very odd on the screen.

Is there any way to make that currency column display right-aligned?

Thanks in advance!

Bob (@Martureo.Org)
 
See:
http://www.lebans.com/justicombo.htm
New Ver 2.1 Justification.zip is a database containing functions to
center and right justify data for List and Combo Boxes.

Major changes for Version 2.1 are:
Use standard API's instead of functions exposed in Access EXE.

Handle Multiple Columns

One Function for both Center and Right Alignment

Support for controls on SubForms

Huge increase in function execution speed

Clean code with comments



--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top