It’s common for an audience to pause a presentation by asking questions and comments. In fact, most presenters like to interact with the audience. However, if the question or comment isn’t relevant to the current slide, it can be a bit distracting. How can you black out (or white out) the current slide?
Last week we asked…
How do you draw a border around a report page in Access? Amasa was the only one to offer a solution — manually adding line objects to all four page margins. That method works, but it requires a steady hand and you must add vertical lines to each report section. In a complex report, that would mean a lot of work. VBA provides an easy and flexible method for drawing a border around a report page. Simply add the following subprocedure to the report’s module:

Private Sub Report_Page()
  Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), , B
End Sub

The above procedure uses the default line property settings to create a border around the report’s margins, enclosing all data, including headers and footers. You don’t have to use the default line properties though; simply set them in the same procedure as follows:

Private Sub Report_Page()
  'Draw border around report's margins. 
  On Error Resume Next
  'Set line's thickness and style.
  Me.DrawWidth = 3
  Me.DrawStyle = 3
  Me.Line (0, 0)-(Me.ScaleWidth, Me.ScaleHeight), vbBlue , B
End Sub

This procedure draws a thick, broken blue line around the margins. The higher the DrawWidth property value, the thicker the line. The DrawStyle property settings follow:

  • 0: (Default) Solid line
  • 1: Dash
  • 2: Dot
  • 3: Dash-dot
  • 4: Dash-dot-dot
  • 5: Invisible line
  • 6: Invisible line (solid interior)

The VB constant vbBlue determines the line’s color. There are several to choose from:

  • vbBlack
  • vbRed
  • vbGreen
  • vbYellow
  • vbBlue
  • vbMagenta
  • vbCyan
  • vbWhite

You can make a border-drawing procedure even more flexible by passing the line width and style values.