[AccessD] Right Justify in List Box

Max (MGA) max.wanadoo at gmail.com
Wed Feb 17 09:02:09 CST 2010


Yes that is a good font. Thanks

Max


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: 17 February 2010 14:22
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Right Justify in List Box

Hi Max

I looked at this again, and MS Sans Serif is not perfect. For a perfect
alignment, the font to use is the OpenType "Lucida Sans", filename
LSANS.TTF, size 64608 bytes, from 1991, by Bigelow & Holmes, Inc. from Type
Solutions, Inc. A very nice, clean, and modern looking typeface.

/gustav


>>> Gustav at cactus.dk 16-02-2010 18:35 >>>
Hi Max

If you use the font MS Sans Serif for the listbox (goes for a combobox as
well), you can use a recordsource like this:

  SELECT 
    SomeField,
    Format([AmountMin], Space(14-2*Len([AmountMin])-Abs([AmountMin]>1000)) &
"#,##0") AS SMin, 
    Format([AmountMax], Space(14-2*Len([AmountMax])-Abs([AmountMax]>1000)) &
"#,##0") AS SMax
  FROM 
    YourTable
  ORDER BY 
    SomeField;

This takes advantage of the fact that space and dot and comma for this font
consume half a "space" while digits consume a full "space".
Not very fancy but it works.

/gustav


>>> max.wanadoo at gmail.com 16-02-2010 17:12 >>>
Hi,

I am trying to get varying values in a LIST Box and have them right
justified.

This won't do the trick...

strTotal = Format(Nz(rst!AcBalance, 0), "##,##0.00")
strTotal = Space(12 - Len(strTotal)) + strTotal

Varying values give varying spacing.

Any suggestions?

Thanks

Max


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list