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

    How to read all the records in the report (Access 2000)

    In my Record source for the report i have an sql that has the following criteria
    "WHERE (((Month([InvoiceDate]))=Forms!Switchboard!Monaten) AND ((Customers.afid)=Forms!Switchboard!Office)
    Depending on the choice in the two option boxes in the form Switchboar.It works fine but when i do not select a choice, i get no results.And what i want is the folloiwng: when no option box in the form is selected, i want to get the results for all the offices of the whole year.How can i do it ?

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

    Re: How to read all the records in the report (Access 2000)

    Try this:

    WHERE (Month([InvoiceDate])=Forms!Switchboard!Monaten OR Forms!Switchboard!Monaten Is Null) AND (Customers.afid=Forms!Switchboard!Office OR Forms!Switchboard!Office Is Null)

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

    Re: How to read all the records in the report (Access 2000)

    Yes,it works now! Thank you !

  4. #4
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to read all the records in the report (Access 2000)

    Dear Hans

    I tried to apply your solution to another report but i got a messagr that i have an extra ). Could you help me find it out?

    The original sql was :
    " WHERE (((Month([InvoiceDate]))=Forms!Switchboard!Monaten) AND ((Customers.afid)=Forms!Switchboard!office) AND ((orders.invoicedate) Between #1/1/2008#
    And #12/31/2008#))" & _
    " ORDER BY [order details].liters DESC;"

    I tried to reformulate it as follows:

    " WHERE (Month([InvoiceDate])=Forms!Switchboard!Monaten OR Forms!Switchboard!Monaten Is Null) AND (Customers.afid=Forms!Switchboard!Office OR
    Forms!Switchboard!Office Is Null) AND ((orders.invoicedate) Between #1/1/2008# And #12/31/2008#))" & _
    " ORDER BY [order details].liters DESC;"

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

    Re: How to read all the records in the report (Access 2000)

    You can easily see which ) is superfluous by counting each ( as +1 and each ) as -1. In the end, the number of ( should balance the number of ) so you should end at 0.

Posting Permissions

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