Results 1 to 8 of 8
  1. #1
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15

    Creating Macros

    I want to create a macro that will automatically run when I open my database and check to make sure that my sums are accurate.



    What I have are 3 querys one Distributor, Dealer, and Aggragate. The Aggragate should equal Distributor+Dealer, and I want to create an automatic macro that will make sure that the above is always true and I would like to have a pop up window warn me when this is not true. Is this possible if so can I get some help setting this up since I am a beginner with access. Thank you

  2. #2
    asmores is offline Novice
    Windows 2K Access 2003
    Join Date
    Mar 2013
    Posts
    20
    There is a few different ways you can do this but i think the best method for you would be to either use a conditional statement within the macro for your popup message and then save the macro as "Autoexec," this will mkae the macro run automatically on open. Another method would be to set up an additional query with an "iif" statement and again saving as Autoexec.

  3. #3
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15
    How would I set the macro up to make it automatically determine if everything is equal, and if the aggragate is not equal to Distributor+Dealer then the macro will show me the pop up?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Just curious. If you are using the same dataset for all three queries, how can the aggragate not be equal to Distributor+Dealer?

  5. #5
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15
    When I was creating the Queries for some reason they did not pull all orders for the aggragate and distributor. The information was all imported into the table but when I ran the query specific orders were not included. I want place an automatic check so I dont have to double check my values every time I pull the reports.

  6. #6
    asmores is offline Novice
    Windows 2K Access 2003
    Join Date
    Mar 2013
    Posts
    20
    Rather then using a pop up and complicating your database try using a force. When you are linking your tables right click on the thin line between the tables and chioce the appropiate link type to include all of your records, this way you will not need to double check it.

  7. #7
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Got it. I've had issues like that.

    I wouldn't use a macro (I never use macros).

    But you could do this easily in code. Open the 3 queries, add the two and compare to the third. If different values, the pop up a message box or display a label on the main form.

  8. #8
    Bvincey2002 is offline Novice
    Windows XP Access 2000
    Join Date
    Aug 2013
    Posts
    15
    I do not know how to use codes. I am very green beginner .

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

Similar Threads

  1. Macros
    By kstyles in forum Programming
    Replies: 2
    Last Post: 07-12-2011, 01:38 PM
  2. Macros
    By Capri Pruitt in forum Access
    Replies: 1
    Last Post: 09-13-2010, 10:36 PM
  3. VBA vs Macros
    By Evgeny in forum Programming
    Replies: 3
    Last Post: 05-11-2010, 02:15 PM
  4. VBA or Macros
    By mastromb in forum Forms
    Replies: 6
    Last Post: 01-03-2010, 04:46 PM
  5. Macros
    By kfhai in forum Access
    Replies: 0
    Last Post: 04-17-2009, 08:28 AM

Tags for this Thread

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