Results 1 to 8 of 8
  1. #1
    Lockrin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    52

    Update Query


    Is it possible to run an update query using VBA and have it NOT ask if you are sure you want to run an update query?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    CurrentDb().Execute YOURQUERY, dbFailOnError
    ...will not issue warnings.

  3. #3
    Lockrin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    52
    For some reason that did not work. Here is exactly what I entered

    CurrentDb().Execute qrySignOffUpdate_Phase2, dbFailOnError

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When you say "that did not work", what happened? What does the rest of the code in that procedure look like?

  5. #5
    Lockrin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    52
    Sorry for the vagueness. I got an error message
    "Run-time error '3708':

    The Microsoft Office Access database engine cannot find the input table or query:. Make sure it exists and that its name is spelled correctly."

    The update query does exist and it is spelled correctly. I also tried putting quotations marks around the query, that didn't work either. And that is the only thing I have in my subroutine thus far. The whole thing is as follows:

    Private Sub UpdSignOff_Click()

    CurrentDb().Execute qrySignOffUpdate_Phase2, dbFailOnError

    End Sub

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    It is the default and should be checked in ac2007 but is there a reference set to the DAO library? I take it you can run the query from the database window, correct?

  7. #7
    Lockrin is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2009
    Posts
    52
    No, I do not believe there is a reference to the DAO library. I searched the module for "DAO" with no results. And yes when I run it from the database window or from a macro it works great with the exception that it requires me to hit "yes" every time I run it.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's an example of how to check:
    http://www.btabdevelopment.com/main/...1/Default.aspx
    ...and it is the Microsoft DAO 3.6 Object Library that needs to be checked.

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

Similar Threads

  1. Update query help
    By techexpressinc in forum Queries
    Replies: 4
    Last Post: 03-31-2010, 07:13 AM
  2. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 AM
  3. Help with update query
    By weirdg in forum Queries
    Replies: 0
    Last Post: 09-03-2009, 04:21 AM
  4. Update Query
    By GrnISSO in forum Queries
    Replies: 0
    Last Post: 06-15-2007, 05:41 PM
  5. Need help with Update Query
    By starswinger007 in forum Queries
    Replies: 1
    Last Post: 02-22-2006, 08:44 PM

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