Results 1 to 1 of 1
  1. #1
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Redcliff, Alberta, Canada
    Thanked 5 Times in 5 Posts

    Report Text Controls - a workaround (Access All Ve

    Here is a workaround to create a telephone list similar to the one in the screen shot below.
    In my report I wanted to concatenate the first and last names, but have the last name bolded. I also wanted a leader between the name and telephone number.
    The problem is that Access can't format separate words within a control.
    Here is what I did:
    1. <LI>Pick a monospace font for the report
      <LI>Bolded the last name and set the control's background to transparent.
      <LI>In the query that provides the data for the report, create a field called GhostName, using the following:
      GhostName: String((Len([LastName]))," ") & " "
      <LI>In the same query, calculated the number of dashes to fill the space between the name and phone number:
      DashLength: 36-(Len([FullName])+Len([Phones]))
      (I am assuming a 36 character width column and FullName is the First and Last Names concatenated together).
      <LI>Created a string composed of the GhostName, FirstName, Dashes and Phone Number(s)
      ReportName: IIf([DashLength]<=0,[GhostName] & " " & [FirstName] & " " & [Phones],[GhostName] & " " & [FirstName] & " " & String([DashLength],"-") & " " & [Phones])
      <LI>Place the ReportName control on the report and sent it behind the LastName control.
    It definitely needs to be tweaked when printed on different printers and different typefaces will require changes to the DashLength. But all in all, it doesn't look too bad.
    Attached Images Attached Images
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts