Fixed field characters

  • Thread starter Thread starter Scafidel
  • Start date Start date
S

Scafidel

I am filling a bank draft field with this code in Expression Builder and
would like it to always fill with "*" to the end whether it is "TEN DOLLARS"
or "FIVE THOUSAND FOUR HUNDRED AND FOURTEEN DOLLARS AND FIFTY CENTS." How
can I do this without always editing the end document?

=("*" & Num2Text([TB],3) & "***********************")
 
If it is a specific number of characters.

= Left("*" & Num2Text([TB],3) & String(100,"*"),100)

That will returned a string of 100 characters. The string will start with an
"*" followed by the output of Num2Text and then have as many "*" characters as
are needed to return 100 characters. If you need more characters then change
both 100 figures to the maximum length of the character string to be returned.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
Scafidel -

If this is a fixed-spaced font, then you just need to know how many
characters fit on the entire line. Say 60 characters fit, then you would use
this:

=Left("*" & Num2Text([TB],3) &
"************************************************************"),60)

If you use a porportinal font, then I don't know how to tell the length.
 
Thanks, John! That did it. I had to force the table to not wrap.
--
Lafayette, LA


John Spencer said:
If it is a specific number of characters.

= Left("*" & Num2Text([TB],3) & String(100,"*"),100)

That will returned a string of 100 characters. The string will start with an
"*" followed by the output of Num2Text and then have as many "*" characters as
are needed to return 100 characters. If you need more characters then change
both 100 figures to the maximum length of the character string to be returned.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
I am filling a bank draft field with this code in Expression Builder and
would like it to always fill with "*" to the end whether it is "TEN DOLLARS"
or "FIVE THOUSAND FOUR HUNDRED AND FOURTEEN DOLLARS AND FIFTY CENTS." How
can I do this without always editing the end document?

=("*" & Num2Text([TB],3) & "***********************")
.
 
If you use a porportinal [sic] font, then I don't know how to tell the length.

I like the look of a fixed-width font on a check for the parts that
vary, but some might prefer proportional fonts. I think there are
some API functions to determine the length of a given text string in a
given proportional font. Maybe:

http://www.lebans.com/autosize_textbox.htm

Creating/using some .NET functions to be called by Access might be
less OS version dependent if you are in an environment where the
existence of the .NET framework is practically a given.

James A. Fortune
(e-mail address removed)
 
Back
Top