Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    May 2001
    Location
    MIA (takittodahous), Florida, USA
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    String Alignment (2000)

    Hi!

    Does anyone have an example of the " ! " string alignment format in an expression? And can I use it with a Numeric expression as well? I have a definition requirement here that needs the numeric string left-aligned.... oy.

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: String Alignment (2000)

    What exactly do you mean by an "expression"? You can use the ! in an input mask, but it doesn't have anything to do with alignment--it controls whether the entry is right to left instead of left to right. Alignment in a field is meaningless anyhow. If you want to align the string or numeric value in a *control* on a form or report, that's a different issue and you don't do it with an input mask, you use the TextAlign property of the control. The syntax for that would be something like this:

    Me!TextBox1.TextAlign = 1

    That will left align the contents of the textbox for display purposes.
    Charlotte

  3. #3
    Star Lounger
    Join Date
    May 2001
    Location
    MIA (takittodahous), Florida, USA
    Posts
    86
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: String Alignment (2000)

    Thanks for the response :-)

    By expression I mean creating a field in design view of a query using the expression builder and formulas vs. just calling up a field from a table. And my output for this query is a text file exporting data to another application, so the alignment or justification of the field is important to the values that application assigns to the record.

    So is there any way to access the TextAlign property in the expression builder?

    thanks again for all your help! Much appreciated.

    -Happy Monday-

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: String Alignment (2000)

    TextAlign is only an aspect of the display of a field, it has nothing to do with the contents of the data.
    If I understand you correctly, you want the exported data to be padded on the left with spaces to a fixed width. You can use an expression like this to do that in a query:

    Right$(Space$(15) & [FieldName];15)

    Substitute the appropriate field name for FieldName, and replace 15 (twice) by the length you want the exported field to have (which must be at least the length of the longest value for the field, otherwise, values will be truncated).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •