Aligning Text

  • Thread starter Thread starter scott
  • Start date Start date
S

scott

I am using

Right$("0000" & [MyField], 4)

This is making sure my phone # is 4 digits long.

The problem is that when I do this...the column is aligned to the left
of the cell.

The rest of the fields are aligned to the right of the cells.

How can I get this column back to being aligned to the right?

Thanks,
Scott
 
Use this:

CInt(Right$("0000" & [MyField], 4))

That will "force" the format to an integer (numeric) format and then it will
align to the right.
 
Um, if you convert it to an integer, you'll lose the leading zeros.

Scott: Use the Format property of the text box: set it to "0000" (without
the quotes)

--
Doug Steele, Microsoft Access MVP



Ken Snell said:
Use this:

CInt(Right$("0000" & [MyField], 4))

That will "force" the format to an integer (numeric) format and then it will
align to the right.

--
Ken Snell
<MS ACCESS MVP>

scott said:
I am using

Right$("0000" & [MyField], 4)

This is making sure my phone # is 4 digits long.

The problem is that when I do this...the column is aligned to the left
of the cell.

The rest of the fields are aligned to the right of the cells.

How can I get this column back to being aligned to the right?

Thanks,
Scott
 
You're right that that's probably better, since Scott should really be using
text fields for his phone numbers, and that would be
the only way to ensure text fields align properly.

(I forgot to mention to Scott that to use the Format property, he wouldn't
use the Right$() expression)

--
Doug Steele, Microsoft Access MVP



Ken Snell said:
Or, you could set the Alignment property of the textbox to Right.

--
Ken Snell
<MS ACCESS MVP>

Douglas J. Steele said:
Um, if you convert it to an integer, you'll lose the leading zeros.

Scott: Use the Format property of the text box: set it to "0000" (without
the quotes)

--
Doug Steele, Microsoft Access MVP



Ken Snell said:
Use this:

CInt(Right$("0000" & [MyField], 4))

That will "force" the format to an integer (numeric) format and then
it
will
align to the right.

--
Ken Snell
<MS ACCESS MVP>

I am using

Right$("0000" & [MyField], 4)

This is making sure my phone # is 4 digits long.

The problem is that when I do this...the column is aligned to the left
of the cell.

The rest of the fields are aligned to the right of the cells.

How can I get this column back to being aligned to the right?

Thanks,
Scott
 
Back
Top