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!

Character similar to space 3

Status
Not open for further replies.

Hargreavesk

Technical User
Jul 18, 2001
97
GB
Hi,

Can anyone tell me if there is a character which is similar to a space but isn't a space???? I know this may sound weird.

Any help would be appreciated.

Regards

Kate
 
Your question is a bit vague. Why doesn't a space work? Would a tab character work? Underscore?

What are you trying to accomplish?

Maq [americanflag]
<insert witty signature here>
 
Maquis,

I want to print a cheque but when I add my asterisks there are problems with text wrapping. If the payee is as follows JoeBloggs******* then everything is fine. However, if the payee is Joe Bloggs****** then I get the following:
Joe
Bloggs********

This has become extremely annoying and I have tried everything. The only thing I can now think of is whether I can replace the spaces with a similar character. Is this any clearer?

Regards

Kate
 
Kate,

Questions for you.....Are you using a fixed font width? Are you trying to fill the remaining space with asterisks??

In other words....you have Joe Bloggs and you want to fill the rest of the space with ***** so no one can write in anything else.

If this is the case, then why not &quot;pad&quot; the text intstead of a set number of asterisks???

I have code that will &quot;pad&quot; a text box to a set length with whatever character you want....so you get the following:

Pad the text to 15 characters
Joe Boggs******
Mary Smith*****
Robert Johnson*

Pad the text to 10 would be
Joe Boggs*
Mary Smith
Robert Joh

If this might be what you need, please let me know if this will work and I will post this code for you. The secret to creativity is knowing how to hide your sources. - Albert Einstein [spin]

Robert L. Johnson III, A+, Network+, MCP
Access Developer/Programmer
 
Robert,

Yes I want to put in a name ie. Joe Bloggs (inc. space) and have the rest of the text field filled with asterisks so that nothing else can be written in it. If your code could help, I would be extremely grateful. However, I need the asterisks to carry on to 3 lines but not wrap the text at the space. Can this be done?

Regards

Kate
 
With the padding code shown in the previous response, you could extend from that with vb code, such as

(after padding)
Field1 = Left(Field1,15) & vbCrLf & Mid(Field1,16,30) & vbCrLf & Right(Field1,15)

This will add in the carriage returns and line feeds if your line were 15 characters long so that it would wrap at the cr's & lf's instead of the spaces.
 
dakota81,

Thanks for your suggestion, It will be really helpful. Mstrmage1768, please can you send me your code and I will use it along with dakota81's suggestion.

Many thanks for all your help.

Regards

Kate
 
Kate,
In VBA and VB, the Chr(13) command will return a space. The Chr(34) command will return a line break (ie, move to next line). So if you want to see the following in a message box:

Joe Boggs
Sam Walker and Clint Westwood (har har)
Added on (Today's Date)

You'd do something like this in code...

Function FunWithChr()
Dim Names as String
Name1 = &quot;Joe Boggs&quot; & Chr(34) & &quot;Sam Walker and Clint Westwood (har har)&quot; & Chr(34) & &quot;Added on&quot; & Chr(13) & Date$
MsgBox Names
End Function

I think you can search the Microsoft Office Help for a list of all the character commands (and their respective numbers). Hope you get it all figured out.

-Josh ------------------
-JPeters
Got a helpful tip for Access Users? Check out and contribute to 'How to Keep Your Databases from becoming Overwhelming!'
thread181-293590
jpeters@guidemail.com
------------------
 
Josh,

Thanks for your suggestions.

Robert, I would be really really grateful if you could send me your code to kate.hargreaves@cis.co.uk.

Many thanks

Kate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top