Print a certain group on a report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geomfg
    New Member
    • Aug 2008
    • 3

    Print a certain group on a report

    Hey all, what I want to try to accomplish in Access 2007 is to create a button on a form that will print a month's worth of records from a report.

    The report is setup like this

    "Date by Month"
    ______"Group 2"
    ____________"Da ta"

    I apologize for my inexperienced explaination.
  • hyperpau
    Recognized Expert New Member
    • Jun 2007
    • 184

    #2
    Program your command button in VBA to open up the report specifying a WHERE Condition on the [DateByMonth] field (if that's your field name).
    Of course to do this, you would need to have an option for the user to select or type in the month that they want to print. I could either be popup box ar more simply an Input Box, o rmaybe another field/control on the form.

    Example:
    [CODE=VB]Private Sub cmdPrint_Click ()
    Dim dteMonth as Date

    dteMonth = InputBox ("Please enter the month you would like to print", "Enter a month")

    docmd.openrepor t "rptMyRepor t", , , "[Date]=" & dteMonth
    End Sub[/CODE]

    Of course you will need some modification based on the current set up of your form/table/report.

    Comment

    • geomfg
      New Member
      • Aug 2008
      • 3

      #3
      Thanks hyperpau for the response. I'll play around some with modify my db.

      Comment

      • hyperpau
        Recognized Expert New Member
        • Jun 2007
        • 184

        #4
        No Problem. Hope you find the solution.

        Originally posted by geomfg
        Thanks hyperpau for the response. I'll play around some with modify my db.

        Comment

        Working...