Subscriber only lesson.
Sign up to this course to view this lesson.
About this lesson
Create a textbox to show the date and time a report was printed, page number, and total pages at the top of each page.
Download this lesson’s related exercise files.Services_34_Start Page Header, Page Numbers, Date, Report Caption.accdb
1.7 MB Services_34_Page Header, Page Numbers, Date, Report Caption.accdb
Page Header, Page Numbers, Date & Time, Report Caption
Ampersand (&) combines, or concatenates, expressions together. Be sure to add space on either side of the & operator.
The Line Tool in the Controls group enables you to draw lines.
The Rectangle Tool in the Controls group enables you to draw rectangles.
Select Controls Using Horizontal Ruler
When you click (or click and drag) in the horizontal ruler, every control that the imaginary vertical line (or rectangle) touches will become selected. This is a good way to find controls that are hanging past where you want a margin to be.
The Report Caption shows in the title bar of a report when it is displayed.
If the report is maximized, the Report Caption will display in the application title bar with the application name.
Add space to the end of a Caption
To add space to the end of a Caption, change the caption IN the control instead of on the Property Sheet. If you change the Caption property, Access will trim the value.
Best-Fit a Label
- Best-Fit a label by double-clicking one of the resizing handles. The big square in the upper left is not a resizing handle.
- Because controls are best-fit for a particular printer and the way they print varies, and screen fonts can also be different, make the label a little wider after you best-fit it.
Move a Label Independent of its Associated Control (and vice-verse)
- To move a label independent of its associated control (and vice-verse), drag it by the big square in the upper left.
Change Font Size in Zoom Box
- To change the font size in the Zoom Box, press (Shift-F2) to open the Zoom Box.
- Click the Font command button in the lower right.
- The font will stay set as long as Access is open.
Change Font Size in Expression Builder
- To change the font size in the Expression Builder, press (Ctrl-F2) to open the Expression Builder.
- Use Ctrl-Mouse wheel to make the font bigger and smaller.
Create Textbox to Show Date and Time Report was Printed, Page Number, and Total Pages at Top of Each Page
- To create a textbox to show the date and time a report was printed, page number, and total pages at the top of each page, go to the Design View of the report.
- Create a textbox in the Report Header section.
- Delete the associated label that gets created.
- Click in the Control Source property for the textbox.
- Press (Shift-F2) to Zoom or (Ctrl-F2) for the Builder.
="Printed " & Now() & ", Page " & [Page] & " of " & [Pages]
- Now() is a built-in function that returns the current date and time. If you just want the date, you may use the Date() function instead.
- Page is the current page number.
- Pages is the total number of pages.
- Anything in quote marks will be printed literally (as it is). Be sure to balance the double quote marks, and include the text, space, and commas you need inside the double quote marks.
- Ampersand (&) combines, or concatenates, expressions together. Be sure to add space on either side of the & operator.
Show Vertical Lines Between Controls but Not Above
To create an effect like this:
- Set the Border Color of the controls
- Cover the top border with a rectangle or other control that has a white fill and no border.
- Draw a heavier Line below the controls.
Lesson notes are only available for subscribers.