Results 1 to 2 of 2
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Thanked 0 Times in 0 Posts

    Report for quarters (Access 2000)

    I have a coloumn in my query defining the quarter of the invoices as follows:
    InvoiceQuarter: Format([InvoiceDate];"q")
    This column shows the quarter when the invoice is issued.
    On that basis i want to build a report depending on the four options on the form, corresponding to the four quatters of the year.For example when i press the first option called First quarter, i want to open the report only for the first quarter of the year.Can i do it with one and the same report ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 28 Times in 28 Posts

    Re: Report for quarters (Access 2000)

    You can create a report based on the query, let's say rptInvoices.

    I assume that you have an option group on your form, let's say grpQuarter.
    Make sure that the Option Value property for the option buttons corresponds to the quarters, i.e. values 1 through 4.
    Place a command button cmdReport next to the option group with the following On Click event procedure:
    Private Sub cmdReport_Click()
    On Error GoTo ErrHandler

    DoCmd.OpenReport ReportName:="rptInvoices", View:=acViewPreview, _
    WhereCondition:="InvoiceQuarter=" & Chr(34) & Me.grpQuarter & Chr(34)
    Exit Sub

    If Err = 2501 Then
    ' Report was canceled, we can ignore that
    MsgBox Err.Description, vbExclamation
    End If
    End Sub
    See Report for quarters on Utter Access for another approach.

Posting Permissions

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