Results 1 to 10 of 10
  1. #1
    Join Date
    Feb 2009
    Posts
    47

    Unanswered: How to Execute Query without Displaying results

    I have a macro that runs 35 queries some are regular queries and some are make table. I wanted to know how to execute the queries but not have them display the results as then I have 16 windows open by the time the macro finishes running. all queries are interlinked an one runs off the output of the other so they have to be executed in a sequence.

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Why do you have to run a SELECT query if you're not going to do anything with the results? Why not just not run those ones?
    Me.Geek = True

  3. #3
    Join Date
    Feb 2009
    Posts
    47

    select queries are needed

    the queries run foramtting and calculations that are needed by following Queries. Some are union Queries, what I want is to display the result of the final Query only.
    The other queries should run but not display the Datasheet View result as it clutters up the Desktop by opening 16 windows and slows down the system.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you don't want feedback to the user, consider wrapping the queries into a macro or a fucntion and set warnigns off att he start of the process, and set warnings on at the end of the process
    Id you do set warnings off then consider putting set warnings on at the fron of you startup form/menu
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Feb 2009
    Posts
    47

    warninigs

    I have the warnings set off because most of the Queires are make table and it asks you several time before deleting and making a new table so I had to put the warnings off. So when do you want me to turn the warnings on again. The table Queries are of no concern as they do not display their output anyway (you have to go and open the table) but the regular queries diplay their ouptuts and mess up my day.

  6. #6
    Join Date
    Sep 2005
    Posts
    19
    so for example, you have query A (select query) as an input to another query B? Am I right to assume that query A is used in the design of query B - ie you see query A in the design window for query B?

    If that's the case, then you can run query B and it will automatically run query A and not open a window for query A's results.

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Talking

    Quote Originally Posted by UNCC-EE
    I have the warnings set off because most of the Queires are make table and it asks you several time before deleting and making a new table so I had to put the warnings off. So when do you want me to turn the warnings on again. The table Queries are of no concern as they do not display their output anyway (you have to go and open the table) but the regular queries diplay their ouptuts and mess up my day.

    What I have done in the distant past was to use: CurrentDB.Execute
    That was wrapped up in a function that ran two different UpdateQueries. That alone takes care of you having to mess with SetWarnings On and Off and it runs smoothly.
    Can't you just select a Form the the final output of all of your queries? Something like
    Code:
     stDocName = "rptJobCharges"
    maybe?

    have a nice one,
    BUD
    Last edited by Bud; 04-23-09 at 14:35.

  8. #8
    Join Date
    Feb 2009
    Posts
    47

    I'll try it out..

    i havent used any VB modules in this DB and kinda trying to avoid them but I will try it..

  9. #9
    Join Date
    May 2005
    Posts
    1,191
    Wow, I've heard of people intentionally avoiding macros and only use VBA (myself included), but never the other way around. If you can do it, great. But I feel sorry for anyone who has to come behind you to develope on it.
    Me.Geek = True

  10. #10
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Sadly, I find that latter to be more common. I can't tell you how many databases I have seen with like 200 macros and ZERO code.

    I've got a new one this month that's a doozie. It's going to take ages to fix up the 1001 design faults in it... and all the things done in weird ways.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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