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

    open report with combo box (Access 2000)

    I have a combo box calkled FindIt with differcnt customers.What i want is to select a customer in the
    combo box FindIt, and then open the report for the sales of this customer.To my regret i do indeed open the report,
    but then only the first sales are shown for this customer.If i do not use the combo box, but put the customer number in the underlying

    query of the report, then i open the report with all the sales of this customer.But not when i use the combo box.
    Obviously the code i use for opening the report is worng.It is the following:

    DoCmd.OpenReport ReportName:="rptInvoicesPerCustomer", _
    View:=acPreview, WhereCondition:="CustomerID = " & Forms!frmF1![FindIt]
    Can somebody tell me why i do not see all the sales when i open the report through the combo box and why i see all the sales if i put the

    number of the customer in the underlying query?
    Can somebody correct my code so that i open the report correctly?

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    USA
    Posts
    379
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: open report with combo box (Access 2000)

    I'm not sure what your report is based on, but I do it a bit differently ...
    My command button has code which merely opens the report, but my report is based on a query that has the combo box value as criteria.
    Have you tried basing rptInvoicesperCustomer on a query that uses [Forms]![frmF1]![FindIt] as the criteria for the CustomerID? As long as frmF1 is open, this should work.
    HTH

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: open report with combo box (Access 2000)

    If this code is running in the AfterUpdate event of the combobox, change Forms!frmF1![FindIt] to Me![Findit] and see if that makes a difference. I'm assuming here that the CustomerID is the bound column in your combobox, right? Otherwise, you'll need to reference the column of the combobox you want to match.
    Charlotte

Posting Permissions

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