Results 1 to 9 of 9
  1. #1
    MarkMichel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    5

    How do I automate queries to run themselves from a form?


    I have created an access database that has 9 queries to produce my end results. I have create a form that has 9 separate buttons to run each query individually. How can I create 1 button to run all 9 queries consecutively?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Have you tried just putting all the code behind the one button?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Are they Action queries, like an UPDATE query? Could use VBA behind a click event.

    CurrentDB.Execute "Your SQL String HERE"

    edit:
    @June7 I am thinking embedded Macro via Wizard

  4. #4
    MarkMichel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    5
    Yes, there are create table queries and update data queries.

  5. #5
    MarkMichel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    5
    I was able to make one button run all of the queries. How can I turn off the prompts so that there isn't any user intervention?

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    In VBA

    CurrentDB.Execute "UPDATE ..."

    If you are using macro, then use

    SetWarnings = False
    ...
    SetWarnings = True

    Why are you having to create tables?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    MarkMichel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    5
    I am taking data from a main table and manipulating it various times to create the end result. I am a self taught person who doesn't know any other way. I am not sure where to put the code you suggest, Should I provide a copy of my db and you could show me? or is there another way. Really appreciate the help.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Are you using macro or VBA?

    Can provide db if you want. Follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    MarkMichel is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jan 2014
    Posts
    5
    I have been able to figure it out. Thank you both for the assistance.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Automate Numbering in form
    By Fauzi in forum Access
    Replies: 3
    Last Post: 02-09-2013, 01:08 PM
  2. New Question: How do I automate queries?
    By admessing in forum Queries
    Replies: 11
    Last Post: 12-14-2011, 01:27 PM
  3. Automate Access Queries
    By andreala in forum Queries
    Replies: 5
    Last Post: 08-23-2011, 06:01 PM
  4. Replies: 5
    Last Post: 07-15-2010, 10:05 AM
  5. Automate sending SMS form MS Access
    By Johan in forum Programming
    Replies: 8
    Last Post: 04-15-2010, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums