Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11

    Angry access 2007 macro

    I have built 12 queries that obtain data from the same 2 tables but for 12 different reports. I have created 12 separate reports as well. I want to run all 12 queries/reports at once. I have set up a filter in which I enter 'from' and 'to' dates, but I have to do this for each query/report. I want to build a macro that will run all 12 reports at once, and all I'll have to do is manually enter the dates one time at the beginning of the macro. I can not get the date filter at the beginning of the macro to operate successfully - keep getting error message. Where can I get good resource data that will help me with this macro? The Microsoft online help doesn't cut it.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    What I would do is create a form to enter the dates on, and have each of the queries get them from there. You could fire off your macro from a button on that form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    OK. Not sure I follow the relationship of the form to the macro. Should have told you I'm a novice at Access so I don't yet understand a lot of the basics. Will need a good reference book for 2007. What would you recommend?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    Sorry, I lost track of this thread. Did you get it sorted out?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    Still trying to figure it out. I'm not familiar with how the form would be created or would work with the macro. Can you suggest a good reference book for Access 2007? Thanks.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    I haven't read any books recently. Just create a form from the Create tab. Add two textboxes to it. I'd give them a date format on the Format tab. Your queries would have a criteria of

    Between Forms!FormName.FirstTextboxName And Forms!FormName.SecondTextboxName

    On the form, add a button that runs your macro.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    Roger that. Will give it a shot. Thanks very much!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    No problem, post back if you get stuck.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    no luck.....created form and text boxes but am lost from there.

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    Did you do this part?

    Quote Originally Posted by pbaldy View Post
    Your queries would have a criteria of

    Between Forms!FormName.FirstTextboxName And Forms!FormName.SecondTextboxName

    On the form, add a button that runs your macro.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  11. #11
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    I created the form, inserted the text boxes, but from that point I'm lost.

  12. #12
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    Did you put the criteria into the query?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  13. #13
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    That's where I get lost. Don't know how to.

  14. #14
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,909
    The query in design view has a row called criteria. For the date field you want filtered, add what I typed above into the criteria, changing the names to yours.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  15. #15
    unit91 is offline Novice
    Windows Vista Access 2007
    Join Date
    Mar 2012
    Posts
    11
    You told me to create a form with text boxes. No criteria row that I can find.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Export Table in Access 2007 to Multiple Workbooks in Excel 2007
    By hutchinsm in forum Import/Export Data
    Replies: 5
    Last Post: 03-01-2012, 05:23 PM
  2. Get "My Documents" in Access 2007 macro
    By RMittelman in forum Programming
    Replies: 7
    Last Post: 10-31-2011, 03:01 PM
  3. 2007 to 2010 macro won't work
    By lmnnt in forum Programming
    Replies: 6
    Last Post: 08-10-2011, 01:55 PM
  4. Replies: 2
    Last Post: 06-18-2011, 09:55 AM
  5. What id macro in Access 2007
    By Alaali in forum Access
    Replies: 1
    Last Post: 02-25-2010, 02:08 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