CAUTION: If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and follow these steps on a copy of the database.
The following example demonstrates how to print a dotted line between a
variable-length name field and a phone number field. To create a
variable-length character string, follow these steps:
- Start Microsoft Access, and then open the sample database Northwind.mdb or the sample project NorthwindCS.adp.
- In the Database window, click Reports under Objects, and then click New.
- Click Design View, select the Customers table, and then click OK.
- Create two unbound text boxes in the detail section of the report. Modify their properties as follows so that the first text box will display the name and the dotted line, and the second text box will display the phone number.
Text Box 1
----------------------------------------------
Name: NameDotString
ControlSource: =[Companyname] & String(88,".")
CanGrow: No
CanShrink: No
Left: 0.3"
Top: 0.08"
Width: 2.8"
Height: 0.17"
FontName: Arial
FontSize: 8
Text Box 2
-------------------
Name: Phone
ControlSource: Phone
Left: 3.1"
Top: 0.08"
Height: 0.17"
FontName: Arial
FontSize: 8
- Set the Height property of the detail section to 0.25".
- Preview the report. Note that the report looks as follows:
Alfreds Futterkiste......................030-0074321
Ana Trujillo Emparedados y helados.......(5) 555-4729
Antonio Moreno Taqueria..................(5) 555-3932
Around the Horn..........................(71) 555-8248