A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Fixed field characters



 
 
Thread Tools Display Modes
  #1  
Old March 24th, 2010, 07:11 PM posted to microsoft.public.access
Scafidel[_3_]
external usenet poster
 
Posts: 11
Default Fixed field characters

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) & "***********************")

--
Lafayette, LA
  #2  
Old March 24th, 2010, 07:28 PM posted to microsoft.public.access
John Spencer
external usenet poster
 
Posts: 7,815
Default Fixed field characters

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 wrote:
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) & "***********************")

  #3  
Old March 24th, 2010, 10:19 PM posted to microsoft.public.access
Scafidel[_3_]
external usenet poster
 
Posts: 11
Default Fixed field characters

Thanks, John! That did it. I had to force the table to not wrap.
--
Lafayette, LA


"John Spencer" wrote:

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 wrote:
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) & "***********************")

.

  #4  
Old March 25th, 2010, 01:14 AM posted to microsoft.public.access
James A. Fortune
external usenet poster
 
Posts: 903
Default Fixed field characters

On Mar 24, 2:53*pm, Daryl S wrote:

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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.