From: JimmieL on
Is there an easier equivalent to the "xg_lPad" function in ACCESS 2007" to
right-align text in a field when doing a query? That function worked with
ACCESS 2003, but does not work when using ACCESS 2007 with the 2003 database.
--

JL
From: Clifford Bass via AccessMonster.com on
Hi Jimmie,

If there are never nulls or zero-length strings in your fields, you
could do something like:

Format("right-justify me", "@@@@@@@@@@@@@@@@@@@@@@@@@")

If there can be nulls or zero-length strings you could use something
like the following:

Right(Space(25) & "Right-justify me!", 25)

Or you could put it into your own function in a standard (not class, not
report, not form) module:

Public Function RightJustify(ByVal varValue As Variant, intLength As Integer)
As String

RightJustify = Right(Space(intLength) & varValue, intLength)

End Function

Then you could use:

RightJustify("Right-justify me!", 25)

Clifford Bass

JimmieL wrote:
>Is there an easier equivalent to the "xg_lPad" function in ACCESS 2007" to
>right-align text in a field when doing a query? That function worked with
>ACCESS 2003, but does not work when using ACCESS 2007 with the 2003 database.

--
Message posted via http://www.accessmonster.com

 | 
Pages: 1
Prev: Update query
Next: round to nearest 5