Print dots dots across page (1 Viewer)

George-Bowyer

Registered User.
Local time
Today, 18:46
Joined
Dec 21, 2012
Messages
177
I have a report that lists employees by company for an annual directory.

However, the directory also has an "index" at the back that lists all employees alphabetically with the Company they work for.

So, this "index" report just has two fields: [fldName] on the far left and [fldCompany] on the far right.

The client wants a row of dots, or preferably ellipses, running across the blank space to make it easier to read across from name to company. They don't want the dots or elipses underneath the name, however.

I am currently thinking:

either, having a full width set of dots and limiting the width of [fldName] to fit over the top so that it hides only the dots it needs.
or
having [fldName] full width and adding the relevant number of dots to the Name string inside [fldName]

Can I have some suggestions on how others would go about this, please?

Many thanks,

George
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:46
Joined
May 21, 2018
Messages
8,463
[fldName] on the far left and [fldCompany] on the far right
I would think you just put a label of dots in between the two fields


For the latter something something like this
Code:
 Public Function FillDots(totalLength As Long, strText As String) As String
   Dim strDots As String
   strDots = String(totalLength - Len(strText), ".")
   FillDots = strText & strDots
 End Function

Test using 100 for length and each client name
Code:
Debug.Print FillDots(100,"Client 123456789")
Client 123456789....................................................................................
Client A............................................................................................
Clientqwerty........................................................................................
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
I was going to post the same solution as MajP so thought you might like to see a screenshot of that in use:



For the items to line up neatly you need to use a monospaced font such as Courier New
 

Attachments

  • Capture.PNG
    Capture.PNG
    6.1 KB · Views: 214

George-Bowyer

Registered User.
Local time
Today, 18:46
Joined
Dec 21, 2012
Messages
177
This works great. Thanks, Guys :)

For the items to line up neatly you need to use a monospaced font such as Courier New

As long as I make the line of dots long enough, the ragged ends are hidden under the right-hand text box, so it all looks neat.
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
This works great. Thanks, Guys :)
As long as I make the line of dots long enough, the ragged ends are hidden under the right-hand text box, so it all looks neat.

LOL...unfortunately not an option in my example but I can see it would work :cool:
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 14:46
Joined
May 21, 2018
Messages
8,463
After thinking about it could be simpler with just a single textbox, and then pass in both name and company. Could be done in a query or calculated control.
Code:
 Public Function FillDots2(totalLength As Long, strText1 As String, strText2 As String) As String
   Dim strDots As String
   strDots = String(totalLength - Len(strText1) - Len(strText2), ".")
   FillDots2 = strText1 & strDots & strText2
 End Function

Code:
Debug.Print FillDots2(100,"Jane Doe", "Company 123")
Jane Doe.................................................................................Company 123
John Smith.................................................................................Company A
 

Micron

AWF VIP
Local time
Today, 14:46
Joined
Oct 20, 2018
Messages
3,476
Interesting solutions, but no one suggested the alternate back color property for the detail section? Dots do present a classic look though.
 

George-Bowyer

Registered User.
Local time
Today, 18:46
Joined
Dec 21, 2012
Messages
177
Interesting solutions, but no one suggested the alternate back color property for the detail section? Dots do present a classic look though.

The client specifically wants dots. Dots is wot they've always had...
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
LOL! Perhaps a dot matrix printer to go with it?

Just to reiterate my previous point. My code is effectively identical to the second example from MajP. I also recommend that approach

I doubt your 'raggedy ends' will always get hidden if you use a separate textbox on the right

The following should illustrate my point about using monospaced fonts such as Courier New....

Code:
Courier New 
Jane Doe.................................................................................Company 123
George-Bowyer.................................................................Print dots across page

Code:
[FONT="Arial"]Arial
Jane Doe.................................................................................Company 123
George-Bowyer.................................................................Print dots across page[/FONT]


Code:
[FONT="Verdana"]Verdana
Jane Doe.................................................................................Company 123
George-Bowyer.................................................................Print dots across page[/FONT]
 

George-Bowyer

Registered User.
Local time
Today, 18:46
Joined
Dec 21, 2012
Messages
177
The following should illustrate my point about using monospaced fonts such as Courier New....


The client specifically wants Times New Roman. Times New Roman is wot they've always had...

LOL! Perhaps a dot matrix printer to go with it?

A dot matrix printer is still a massive leap forward from quill pen and abacus...
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
Code:
[FONT="Times New Roman"]Times New Roman
Jane Doe.................................................................................Company 123
George-Bowyer.................................................................Print dots across page[/FONT]
 

George-Bowyer

Registered User.
Local time
Today, 18:46
Joined
Dec 21, 2012
Messages
177
Code:
[FONT="Times New Roman"]Times New Roman
Jane Doe.................................................................................Company 123
George-Bowyer.................................................................Print dots across page[/FONT]

Yep. I get your point. The client doesn't. He wants TNR anyway.

But running enough dots across to the fldCompany text box so that the space is always filled, no matter how short fldName is, gives a nice straight edge, so he's happy.
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
Yep. I get your point. The client doesn't. He wants TNR anyway.

But running enough dots across to the fldCompany text box so that the space is always filled, no matter how short fldName is, gives a nice straight edge, so he's happy.

At least he doesn't want Comic Sans :rolleyes:
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 18:46
Joined
Jul 9, 2003
Messages
16,244
At least he doesn't want Comic Sans :rolleyes:
I love Comic Sans and I've never understood peoples objection to it. I mean is it the name? How can the name affect the look of something? If it was called smart text, flashy text, beautiful text, would people look on it in a different light, or is there something inherently in the look of it that people find disquieting? I Just don't understand?

It seems more like to me that someone somewhere said don't use that text because it looks horrible and everybody fell with them.

Sent from my SM-G925F using Tapatalk
 

isladogs

MVP / VIP
Local time
Today, 18:46
Joined
Jan 14, 2017
Messages
18,186
its ok, I'm not a Comic Sans denier!
In fact I also like it as its very easy to read.
However I would never use it in a formal document where I think it would be out of place
 

Users who are viewing this thread

Top Bottom