+ Reply to Thread
Results 1 to 9 of 9

running report according to many condtions

  1. #1
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    running report according to many condtions

    hi all
    i have form used to run report called final ,it contains many fields
    i set text boxes to set my condition's through it ,it works perfectly
    but
    when i thought to collect all the conditions together i failed because i am not experience enough with coding .

    so i am looking for your help .
    that is my codes i used in my form :

    the following corrupted character is not english words ,so no problem with them at all

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Please Login or Register  to view this content.

    and that what i am trying to do :
    Please Login or Register  to view this content.

    i know that this sentence (DoCmd.OpenReport "final", acViewPreview) should be removed and put some thing like & or and or what ever code need .
    i don't know exactly how to write this code
    so your help will be appropriated
    regards,
    sherif

  2. #2
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: running report according to many condtions

    You should be able to do this:


    Please Login or Register  to view this content.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: running report according to many condtions

    so i have to put
    & " AND " &
    between every one ?

  4. #4
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: running report according to many condtions

    That part of the OpenReport function is basically the WHERE clause of a SQL statement without the WHERE keyword. So you'd set it up like you are building a SQL statement. When you want to use more than one condition in the WHERE clause, you AND them together.

  5. #5
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: running report according to many condtions

    it gives message " run time error " some thing wrong ,but i don't know what
    any advise ?

  6. #6
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: running report according to many condtions

    Run Time Error is a generic error label. I won't know unless you provide more info. What line is it on?

  7. #7
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: running report according to many condtions

    i found another way to achieve my target ,
    thanks for you

  8. #8
    Forum Expert davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2010
    Posts
    1,884

    Re: running report according to many condtions

    It would be helpful for others who may run into the same issue if you could post your solution. This forum is read by many people, and there could be others trying to find a way to do what you did.

  9. #9
    Registered User
    Join Date
    10-03-2009
    Location
    cairo
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: running report according to many condtions

    sure with my pleasure
    i found a sample to generate the report you want easily building on amazing query
    hope that help all of you
    please check the attached file , and tell me if you like it
    kind regards
    sherif
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1