Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Report Criteria Lookup (2003)

    Is there a way when running a report and the report ask what criteria you want it based on, that there can be some kind of lookup for that criteria. In other words when running the report it asks "Beginning Supplier ID?". Is there a way at that point to have a combo box or lookup to pick the Supplier ID? Multi column lookup would be the best.

    Kent

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

    Re: Report Criteria Lookup (2003)

    The best way is to create a form a combo box displaying available suppliers, and a command button that opens the report with the appropriate where-condition.

    Say that the combo box is named cboSupplierID, that the command button is named cmdOpenReport and that the report is named rptSomething. The On Click event procedure for the command button could look like this - adapt it for your own needs:

    Private Sub cmdOpenReport_Click()
    If IsNull(Me.cboSupplierID) Then
    ' Nothing selected - just open report
    DoCmd.OpenReport "rptSomething", acViewPreview
    Else
    DoCmd.OpenReport "rptSomething", acViewPreview, , "[SupplierID] = " & Me.cboSupplierID
    End If
    End Sub

    This assumes that SupplierID is numeric.

  3. #3
    Star Lounger
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Report Criteria Lookup (2003)

    Thanks Hans. I'll give that a try. I was hoping there might be a way to do this when just going to reports and running a specific report but I guess the combo is going to require a form be used. Thanks for your help.

    Kent

Posting Permissions

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