By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,163 Members | 934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,163 IT Pros & Developers. It's quick & easy.

Access 2007 - Placing a portion of report text in a particular column

P: 1
I'm using Access 2007 under Windows XP.

I'm creating a a multiline directory list for members of a club with three lines for each member.

Each listing has three textboxes and within the first textbox I have code like:
=Trim(lastname] &", " & [firstname] ...... & [Telephone]) with more fields where I show the ...... in this example.

I want the Telephone data to start at a specific column so that all Telephone data lines up. What do I add to insure this?
Sep 29 '08 #1
Share this Question
Share on Google+
1 Reply


ADezii
Expert 5K+
P: 8,669
The following code will precisely position the Telephone Numbers at Column 25. I used the [LastName], [FirstName], and [HomePhone] Fields from the Northwind Database for my code demo and will display the SQL along with the subsequent Output. In order for this logic to be effective, you must used a Fixed Width Font in Datasheet View, such as Courier:
  1. SQL
    Expand|Select|Wrap|Line Numbers
    1. SELECT [LastName] & ", " & [FirstName] & Space$(25-Len([LastName] & ", " & [FirstName])) & [HomePhone] AS [Directory List]
    2. FROM Employees;
  2. OUTPUT
    Expand|Select|Wrap|Line Numbers
    1.             Directory List
    2. Davolio, Nancy           (206) 555-9857
    3. Fuller, Andrew           (206) 555-9482
    4. Leverling, Janet         (206) 555-3412
    5. Peacock, Margaret        (206) 555-8122
    6. Buchanan, Steven         (741) 555-4848
    7. Suyama, Michael          (171) 555-7773
    8. King, Robert             (761) 555-5598
    9. Callahan, Laura          (206) 555-1189
    10. Dodsworth, Anne          (741) 555-4444
    11.  
Sep 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.