Dots between fields in Access

GreenDot

New member
Local time
Today, 03:46
Joined
Jan 31, 2007
Messages
3
I am creating a four column phone listing report for the Sprint phonebook. How do I create dots between the name and the phone number so that the columns are even?

example:

LastName, FirstName.......PhoneNumber
LastName, FirstName...... PhoneNumber
etc...

Thanks!!!!!!!!!
 
A little more information about how you're trying to go about it now might be handy :)
 
Create an unbound textbox on your form
In the Control Source of the field put
=[LastName] & ", " & [FirstName] & "......" & [PhoneNumber]

Dave
 
Now is this a report or a form?
if you just want a neat row of dots as the third column then stick in a text box with dots in.

Peter
 
I think GreenDot is asking how to insert the correct number of dots so that regardless of the length of the names, the phone numbers on the report are aligned.
 
the phone numbers will always be aligned anyway, that is the way controls work! What you may get is a variable gap between the end of the first name and the start of the phone number
 
What you have to do is figure how many dots to place between the end of name and phone number. In order to do that GreenDot's got to pick an arbitrary number for the length of the total line (Name, Dots,Phone Number) and add a couple characters so that even the longest name will have 2 or 3 dots, then use an expression like:

Code:
Dots = String(LineLength - (Len(LastName) + Len(FirstName) + Len(PhoneNumber)), ".")

Where Dots is the number of dots to insert. The easiest way to do this, I think, would be to have a single control on the report with the control's source as:

LastName & ", " & FirstName & Dots & PhoneNumber
 
Last edited:
which is why I queired if it a report of form, he spoke of a report but posted in the forms forum.
just doing =[firstname] & String(25,".") will do what he wants as long as the fields are butted up, fine for a report but not editable if used in a form.

Peter
 
I dont think counting dots would work very well unless you use a non proportional font.

Why not just concatenate more dots to the right than you will ever need and left justify the control.
 
The number of dots have to be different depending on the length of the combination of first and last names! If the number of dots are the same for every entry you'll get something like this:

Adams, Benjamin............222-0987
Bailey, Joe............230-9807
Connors, Dan............254-0923

Each of the above have 12 dots between the names and phone numbers. To have the phone numbers aligned, you have to determine how many dots go between name and phone number.

Dots = overall length - (length of names) + (length of phone number)

where overall length is a number of characers big enough to encompass all of the names and number plus a few spaces for dots.
 
If each item is in it own box, then the columns will line up!
As Denisk says- dots are smaller than M's in most fonts so
............
MMMMMMMMMMMM

?????
 
Missinglinq- Yes, you understand... you message is exactly it....the data in the four columns my report is coming out just like below.

"The number of dots have to be different depending on the length of the combination of first and last names! If the number of dots are the same for every entry you'll get something like this:

Adams, Benjamin............222-0987
Bailey, Joe............230-9807
Connors, Dan............254-0923"
 
What you're asking for is very complicated in Access. It would be easy to do in a word processor where you'd simply use a dot leader tab. The problem is that Access is not a word processor... even if sometimes it gives the appearance of being one.

Anyway, what you want CAN be done with some complicated coding. Check out http://www.lebans.com/leaderdots.htm for a solution.
 
Rootbear---THANK YOU, THANK YOU......THAT IS WHAT I NEED!!!!!!!!! YOU ALL HAVE BEEN AWESOME.
 

Users who are viewing this thread

Back
Top Bottom