Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Specify Character Spacer

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> Microsoft Access
View previous topic :: View next topic  
Author Message
neonasafluni
New Member


Joined: 03 Feb 2007
Posts: 5
Location: West Bend, WI

PostPosted: Tue Jan 06, 2009 4:24 pm    Post subject: Specify Character Spacer Reply with quote

Is it possible to format character spacer in a string?

=[CCandPAC] & "." & [ObjectAccount]

but I want the individual letters in the resulting character string to be spaced out.

For example the report would show the following result:

9238.4396.6055

but I want it to look like this

9 2 3 8 . 4 3 9 6 . 6 0 5 5

Thanks.
Back to top
View user's profile Send private message
LindaSimpson
New Member


Joined: 21 May 2007
Posts: 24
Location: Cleaveland, IH

PostPosted: Tue Jan 06, 2009 4:31 pm    Post subject: Reply with quote

=JustifyString([CCandPAC] & "." & [ObjectAccount]," ")


Code:
Public Function JustifyString(strIn As String, strChar As String) As String
   
Dim intTemp As Integer   
Dim strTemp As String   
 
For intTemp = 1 To Len(strIn)       
       strTemp = strTemp & Mid(strIn, intTemp, 1) & strChar   
Next     

JustifyString = Left(strTemp, Len(strTemp) - Len(strChar))

End Function


Place the above Function in a VB Module that is not the same name as the Function.

In the second argument of JustifyString, put whatever you want to place between each character in a string:

JustifyString("9238.4396.6055", Space(5))
9 2 3 8 . 4 3 9 6 . 6 0 5 5

JustifyString("9238.4396.6055", " | ")
9 | 2 | 3 | 8 | . | 4 | 3 | 9 | 6 | . | 6 | 0 | 5 | 5

JustifyString("9238.4396.6055", "_^_")
9_^_2_^_3_^_8_^_._^_4_^_3_^_9_^_6_^_._^_6_^_0_^_5_^_5

JustifyString("9238.4396.6055", Chr(5))
9238.4396.6055
________
C20let
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> Microsoft Access All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group