[AccessD] Friday Puzzler - Access 2007 - "Report View" "On Format"and "On Paint" Events

A.D. Tejpal adtp at airtelmail.in
Fri Oct 29 23:41:18 CDT 2010


Brad,

    It is not clear whether you happened to connect my post of 29-Oct-2010 (copy placed below), suggesting a way to fire the format event by transitioning from report view to print preview by double click on page header. This was in response to your thread "How tosuppressspecificreportlineswhileusingacViewReport"

    If the proposed approach was found successful, action on similar lines could be considered for realizing your current objective as well.

Best wishes,
A.D. Tejpal
------------

  ----- Original Message ----- 
  From: A.D. Tejpal 
  To: Access Developers discussion and problem solving 
  Sent: Friday, October 29, 2010 14:48
  Subject: Re: [AccessD] How tosuppressspecificreportlineswhileusingacViewReport


  Brad,

      Apparently you wish to play with the report in report view and 
  thereafter, before printing, carry out selective suppression of detail 
  section, say by setting Cancel = True in its format event, as dictated by 
  suitable conditional check.

      Following course of action is suggested (based upon Access 2010 on Win 
  XP):

      Place suitable code in detail section's format event in report's module. 
  Sample code:
  '===============================
  Private Sub Detail_Format(Cancel As Integer,  _
                                  FormatCount As Integer)
      If <<MyConditionExpression>> Then
          Cancel = True
      End If
  End Sub
  '===============================

      Place the following code in dbl click event of page header section in 
  report's module:
  '===============================
  Private Sub PageHeaderSection_DblClick(Cancel As Integer)
      DoCmd.RunCommand acCmdPrintPreview
  End Sub
  '===============================

      After opening the report, whenever you are ready for final stage, dbl 
  click in page header section, will take you to the preview mode, accompanied 
  by firing of format event, delivering desired output.

  Best wishes,
  A.D. Tejpal
  ------------
  ----- Original Message ----- 
  From: Brad Marks 
  To: Access Developers discussion and problem solving 
  Sent: Saturday, October 30, 2010 01:11
  Subject: [AccessD] Friday Puzzler - Access 2007 - "Report View" "On Format"and "On Paint" Events


  When using “Report View” in Access 2007, the “On Format” event is not fired (we need to use “Report View” features).

  The “On Paint” event, however, is fired.

  In the “On Paint” Event
  Me.Box1.BackColor = vbBlue
  Works nicely

  However the command
  Me.Box1.Width = 1000
  issues the message “The setting you entered isn’t valid for this property”, although this exact command will work with a test button.

  Is there a way to resolve this?  I would guess that other Access 2007 users have run into similar issues with Report View.

  Thanks,
  Brad  


More information about the AccessD mailing list