Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Jul 2002
    Location
    London, Kent, England
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Force a Query (97 )

    Query 1 grabs some data

    Query 2 grabs some data

    Query 3 adds items from query 1 and 2

    Switchboard button 1 calls a macro (and takes the search criteria from a listbox)

    macro calls the report


    If i run just the query,i get the correct answers, but i i try from the listbox on the switchboard, it appears the query is not doing anything it replies with blanks.


    So, do i need to add some commands in the macro to force the queries to update themselves ?

    Any pointers much appreciated [img]/forums/images/smilies/smile.gif[/img]

    Mora

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Force a Query (97 )

    I think we need a few more details here:
    <UL><LI>Is Query 3 using Query 1 joined to Query 2 as it's data source?
    <LI>You mention a listbox - is that on a form somewhere that is referenced as a criteria in one or more of the queries?
    <LI>Is the report you are opening bound to Query 3, or something else?
    <LI>Do you have any filters being applied when you open the report?[/list]As to your question about forcing the queries to update, no. Queries are always updated when you use them as a data source.
    Wendell

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Force a Query (97 )

    For the holidays, as you say, build a table of these.
    When counting the holidays between a range would it be easier to just use a query in a recordset to just count the number of holidays between the range of dates, then subtract this number from your number of days between the range of dates (minus the weekends of course).
    HTH
    Pat <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

  4. #4
    New Lounger
    Join Date
    Jul 2002
    Location
    London, Kent, England
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Force a Query (97 )

    Ahh, you are correct of course, thanks wend, your statement made me go back and check everything once again, and of course it was my foolish error. The queries do update themselves when asked.

    my 2nd problem of the day though if anyone can point me in the right direction, is that i have some code garnered from the web to work out the amount of working days.

    However, i have no no idea how to make it work. I need the amount of working days placed in to query 2 as a number.

    This is the code.

    Calculate working days between two dates
    faq181-261 from the Tek-Tips website.


    I created a table called 'tblHolidays' and populated it with the correct dates, however i have no idea how to call this code. do i place it in a module?
    I presume that somehow i have to pass the start date and end date to it somehow .
    tia

    mora

    Edited by Charlotte to remove copyrighted material

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

    Re: Force a Query (97 )

    I just wanted to explain to everyone why the code previously posted here has been replaced with a link to a website. <!rule=13>Rule 13<!/rule> states that copyrighted material should not be posted, and the Tek-Tips website, the source of the code, includes the following copyright notice: <blockquote><hr>Copyright
    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
  •