Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2006
    Posts
    13

    Unanswered: Macro- Automatically Answer Yes to PopUps

    hey again,

    I have a macro that has a bunch of update queries, i want to have the macro answers "yes" automatically to "You are about to run a Update Query...Are you sure you want to modify existing data" so i dont have to sit there clicking a thousands times.

    Thanks in advance

    John

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    possibly not the most helpful response in the universe...

    don't - kill all popups - they are there for a reason.
    don't - use macros
    if you want to execute UPDATE queries without all the fuss from mother-Gates:
    currentdb.execute "UPDATE tblBlah SET this = that"
    ...it is also faster (JET db) than whatever alternative method you are using.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Nov 2006
    Posts
    13
    well the big man wants a macro so its on Ctrl + U, and all finished... so with your code, can i just re-write my all my update queries in VBA then do a RunCode macro.

  4. #4
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    tell me about the big man!
    i have some that i can share with you if you need.

    i don't know a thing about A-macros - i imagine they can run code, but i don't know if they still fuss when you .Execute strSQL

    if your pension doesn't depend on a bullet-proof application, you can maybe try the macro equivalent of
    docmd.setwarnings false
    'blah all your updates here
    'blah all your updates here
    'blah all your updates here
    docmd.setwarnings true

    NO IDEA if this stuff is available to macros - sorry.

    izy
    currently using SS 2008R2

  5. #5
    Join Date
    Nov 2006
    Posts
    13
    thanks...to everyone else using this as a reference

    Code:
    Private Sub UpdateQueries()
    
    DoCmd.SetWarnings False
    
    DoCmd.OpenQuery "QUERY NAME 1", acViewNormal, acAdd
    DoCmd.OpenQuery "QUERY NAME 2", acViewNormal, acAdd
    DoCmd.OpenQuery "QUERY NAME 3", acViewNormal, acAdd
    DoCmd.OpenQuery "QUERY NAME 4", acViewNormal, acAdd
    
    
    DoCmd.SetWarnings True
    
        DoCmd.Close
           
        
    Exit_UpdateQueries:
        Exit Sub
    End Sub
    You might have to change things around to fit your needs
    Last edited by smokinflapjack; 01-23-07 at 13:32.

  6. #6
    Join Date
    Nov 2006
    Posts
    13
    kinda disappointing but after i was done i also found in the macro options

    SetWarnings
    No-Yes

Posting Permissions

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