Number formats & text align

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?
 
K

Ken Snell [MVP]

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
 
G

Guest

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).
 
K

Ken Snell [MVP]

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>
 
G

Guest

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...
 

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