Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    selecting multiple reports to print (2000-SR1)

    I want to make a form to allow users to select any of a number of reports to print, both by checkboxes with each report and a checkbox to select one or more preset groups of reports, such that they could choose anywhere from one to about 40 reports possible to print. Where could I find the instructions on how to set that up?

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

    Re: selecting multiple reports to print (2000-SR1)

    To print a report, you can use

    DoCmd.OpenReport "ReportName"

    You can test whether a check box has been ticked, and issue an OpenReport instruction if so:

    If Me.chkReport1 = True Then
    DoCmd.OpenReport "Report1"
    End If

    etc. If you want one check box to print several reports, just include more than one OpenReport instruction between the If ... Then and End If lines.

  3. #3
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: selecting multiple reports to print (2000-SR1)

    Thanks, Hans...working on that.

  4. #4
    2 Star Lounger
    Join Date
    Jan 2005
    Location
    Wichita, Kansas, USA
    Posts
    209
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: selecting multiple reports to print (2000-SR1)

    On that same form, how might I do "Check All" and a "Clear All" command buttons, to set or clear the option buttons?

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

    Re: selecting multiple reports to print (2000-SR1)

    If those check boxes are the only ones on the form, you can use code like this:

    Private Sub cmdCheckAll_Click()
    Call SetCheckBoxes(True)
    End Sub

    Private Sub cmdClearAll_Click()
    Call SetCheckBoxes(False)
    End Sub

    Private Sub SetCheckBoxes(OnOff As Boolean)
    Dim ctl As Control
    For Each ctl In Me.Controls
    If ctl.ControlType = acCheckBox Then
    ctl = OnOff
    End If
    Next ctl
    Set ctl = Nothing
    End Sub

Posting Permissions

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