Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text box with trailing spaces 2

Status
Not open for further replies.
Oct 24, 2002
512
US
I've posted this in other threads 'cause I'm desperate to get this project finished. Please ignore and accept my apologies if you've already seen this.

I've almost got the 401(k) export finished. Thanks to all who have helped me this past week. One last plea for help (keyword search is still down).

I don't know how to put trailing spaces after data in a text field. For example, a text field must be exported with a length of 30 but the address data in that field is frequently less than 30 characters. I need to add spaces to the end of the address to fill up the field. Ann
 
something like this should work

county = "county" & Space(30 - Len("county")) Christiaan Baes
Belgium
"What a wonderfull world" - Louis armstrong
 
Hi Chrissie. CUOK just helped me in another thread with the same idea. I was trying to figure out how to get chr(32) to repeat to the end of the field. I've got lots to learn. Thanks. Have a star. Ann
 
Is there any way to do the same thing, substituting zeroes for spaces?? Thanks! Susan M. Wagner
womanofcode@yahoo.com
swagner@imperialfoodsupply.com
 
To pad your field with trailing zeros use the string function instead of the space function:

county = "county" & String(30 - Len("county"), "0")

Ted
 
Hmm, that is very helpful, but I need some fine tuning...

I have a variable-length field, and need it to be output as a 15-character field with leading zeroes. After your input, I currently have the following in the query field:

InvNo: String(15-Len("InvoiceNo"),"0") & [InvoiceNo]

However, the result is 6 zeroes followed by whatever was in the original field.

Help?
Thanks! Susan M. Wagner
womanofcode@yahoo.com
swagner@imperialfoodsupply.com
 
Try this..

InvNo: String(15-Len([InvoiceNo]),"0") & [InvoiceNo]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top