Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Summary view (access 2000)

    I have a report in both detail view and summary view.it enumerates the number of the invoices and in the summary view summarizes them.I want to open one and the same report for both cases
    to make invisible the detail view, to readjust the format and vice versa.What is the best method to do that ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Summary view (access 2000)

    Create a form with two command buttons: cmdDetails to open the report for both summary and details, cmdSummary to open the report for summary only.

    At the top of the form module, declare a public variable:
    <code>
    Public DetailsOnly As Boolean
    </code>
    Create On Click event procedures for the command buttons:
    <code>
    Private Sub cmdDetails_Click()
    DetailsOnly = False
    DoCmd.OpenReport "rptCategories", acViewPreview
    End Sub

    Private Sub cmdSummary_Click()
    DetailsOnly = True
    DoCmd.OpenReport "rptCategories", acViewPreview
    End Sub
    </code>
    Replace rptCategories with the name of your report. Save the form as (for example) frmReportChoice.

    Also create an On Open event procedure for the report:
    <code>
    Private Sub Report_Open(Cancel As Integer)
    If Forms!frmReportChoice.DetailsOnly = True Then
    Me.Detail.Visible = False
    End If
    End Sub
    </code>
    If necessary, change Detail to the name of the detail section of your report.

  3. #3
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Summary view (access 2000)

    Tahnk you Hans. Did i overlook something ? I followed the instructions but the report is opened in full in both cases. Would you have a look ?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Summary view (access 2000)

    You have put code in the On Open event of the form instead of in the On Open event of the report. Remove the code for the On Open event of the form, and create code for the On Open event of the report, as indicated in my previous reply.

  5. #5
    3 Star Lounger
    Join Date
    Feb 2004
    Location
    Burgas, Bulgaria
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Summary view (access 2000)

    Excellent ! Hans, thank you !

Posting Permissions

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