Number formats & text align

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

On a particular report, I have a column that includes text boxes formatted as
Currency above/below text boxes formatted as Standard, from 0 to 3 decimal
points.

Although all the text boxes are identical in all other regards
(size/alignment, 0 margin, Right text align, font, etc.), my client has
pointed out that there is a variance in the right alignmemt. Sure enough,
there is; Standard values with 0 decimal point are aligned approximately 1/2
character to the right of Standard values with 1 or more decimal points, and
Currency boxes are, in turn, aligned 1/2 character to the right of these.

While I couldn't care less, my client is insistent that everything align
perfectly. Is there any way to do this short of visually trial-and-error
adjusting the width (right edge) of all the text boxes?
 
Override the Currency format in your textbox (Currency leaves that empty
space because it represents negative numbers with ( ) characters instead of
using a minus sign). Use this expression, for example, in the textbox's
Format property:

$#,##0.00;-$#,##0.00
 
Thanks, Ken.

That takes care of the Currency ones. For Standard, though, there is an
alignment differential between those with 0 decimal places and those with one
or more decimal places. It appears that the decimal place pushes the right
alignment about 1/2 character to the right (still enough for my client to
complain).
 
Picky, picky client, eh?

Don't know any way around that other than perhaps coding the Format event to
test if the textbox will contain any decimal places or not (could do by
seeing if it contains a . character, perhaps), and if it doesn't, adjust the
RightMargin property of the textbox by an amount that will cause the
textbox's contents to be aligned with those other textboxes.

--

Ken Snell
<MS ACCESS MVP>
 
Thanks. That'll teach me to mix my number formats (at least for this client)!
Since the decimal points, 0 or otherwise, are set in the properties of the
text box and therefore do not vary for that box, I ended up just changing the
width of the respective boxes enough so that it looks right.

What a pain, though, and I'll probably forget next time I work on that
report and "clean up" the text box sizes...
 
Back
Top