Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Separate Report (2003)

    Hi,

    Current I have a summary report base on Service Category group in the dbase. If I click run report button, the summary report will pops up with 25 pages by 25 service category.

    Now user request to have 25 reports for each service category instead of having one report with 25 pages.

    So what's the best way to do it?

    Thanks

    Regards

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

    Re: Separate Report (2003)

    I assume you don't really want to design a separate report for each service category. Keep the report as it is.

    You can do the following:
    - Create a small form with a combo box from which the user can select a service category.
    - Put a command button on the form to open the report for that service category only.
    - The On Click event procedure for the command button would look like this, with the appropriate names substituted:
    <code>
    Private Sub cmdReport_Click()
    On Error GoTo ErrHandler

    If IsNull(Me.[ComboBoxName]) Then
    Me.[ComboBoxName].SetFocus
    MsgBox "Please select a service category.", vbExclamation
    Exit Sub
    End If

    DoCmd.OpenReport "rptSummary", acViewPreview, , "[CategoryID] = " & Me.[ComboBoxName]
    Exit Sub

    ErrHandler:
    ' Ignore error 2501 = report canceled
    If Not Err = 2501 Then
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    </code>
    The above code assumes thay you have a numeric ID for the service categories. If they have a text ID, use
    <code>
    DoCmd.OpenReport "rptSummary", acViewPreview, , "[CategoryID] = " & Chr(34) & Me.[ComboBoxName] & Chr(34)
    </code>
    Take care to replace the names in the code with the ones you use.

  3. #3
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Separate Report (2003)

    Thanks, Hans.

    But user still have to click 25 times for all 25 service category report. If there's a way, user just click one time, then 25 service category reports pops up. Yes, I really don't want to create 25 reports.

    Thanks

    Regards

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

    Re: Separate Report (2003)

    What would be the purpose of having 25 reports popping up?
    If the user wants to print a report for each service category in one go, you can specify that each record starts on a new page, by setting the Force New Page property of the Detail section of the report to Before Section.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2006
    Posts
    504
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Separate Report (2003)

    Thanks, Hans.

Posting Permissions

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