Adding dotted line at end of report control string

SkyCraw

Registered User.
Local time
Today, 16:48
Joined
Oct 9, 2013
Messages
100
Good day/night everyone,

For clarification, this is what I would like to accomplish. I have a report control (with "Can Grow" enabled) where I would like to add a dotted line from the end of the contained report string to the right end of the report control. Meaning, something (roughly) like this:

Capture.PNG

Please let me know if there's already a post for something like what I'm asking for as I haven't really found anything for what I'm looking to do thus far.

Any help would be greatly appreciated! :)
 
Thanks for the tidbit, pbaldy!

Do you know how I would set the concatenation so the string of dots go the end of the control with "Can Grow" enabled?

Is there a way within VBA to determine what length of dots would be needed to go from the end of the string to the right end of the control?

Code:
Dim sLength as String

'code to check for length
sLength = 'code result

Me.cThing.ControlSource = "=" & " & [Field] & String(" & sLength & ",".")"
 
It's been close to a month since I posted this, just wondering if anyone know of anyway I can accomplish this?

Or is this an impossible idea, even with VBA.
 
Sorry, I didn't really know a way and hoped somebody would. Conceptually what you suggest could work. You'd have to know the character width of your textbox, let's say it's 20. You can use the Len() function to get the length of the actual text; let's say it's 35. Then you'd find the difference between the actual length and the next multiple of the textbox width and add that many dots. I'd probably create a function rather than trying to calculate it all in the control source, but that's me. Complicating matters is your chosen font; many (most?) are not fixed width, so the number of characters isn't determinative. Each of these is 10 characters:

iiiiiiiiii
GGGGGGGGGG
 
Thanks for the suggestion, pbaldy! Just like you, I was hoping someone would have a simple yet ingenious solution for this (which, there usually is in the programming world!).

That's also the end-goal solution I was hoping to end up with but, with different width fonts/characters, there is no constant to go by as to how many characters can be squeezed into an n length control box. Because of this factor...

The following...

Description of stuff -
and other things......

...could easily become this:

Description of stuff -
and other things......
....
 

Users who are viewing this thread

Back
Top Bottom