Results 1 to 3 of 3
  1. #1
    John Southern is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    31

    Access warning message


    I have some code that executes 10 related queries 8 of which are Make Table Queries. When the code is run the user gets the message asking if it is all right to delete and rewrite each of these tables. It is always OK and I would like to either run the message once or not at all. Is there a way this could be done.
    John

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    If youre referring to the standard "you will be deleting x number of rows" dialog box that pops up, you can use the docmd.setwarnings false to turn it off and then substitute it with your own. you would use the following.

    reply = msgbox "Are you sure? there is no going back!", vbyesno

    if reply = vbyes then
    'your code here
    else
    exit sub
    end if

    hope this helps.

  3. #3
    Rawb is offline Expert
    Windows XP Access 2000
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Quote Originally Posted by John Southern View Post
    I have some code that executes 10 related queries 8 of which are Make Table Queries. When the code is run the user gets the message asking if it is all right to delete and rewrite each of these tables. It is always OK and I would like to either run the message once or not at all. Is there a way this could be done.
    John
    To disable the warning for each query, use the following VBA Code. Be careful though, because if Code execution stops for any reason (say a problem running one of the Queries or because execution was intentionally halted) before the last line is run, all warning messages in Access will remain turned off until you restart Access.

    Code:
    DoCmd.Setwarnings False
    ' Queries go here
    DoCmd.SetWarnings True

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

Similar Threads

  1. Replies: 9
    Last Post: 11-22-2011, 05:23 PM
  2. Error Message after exporting MS Access Table
    By samjoseph in forum Access
    Replies: 1
    Last Post: 02-22-2010, 04:08 PM
  3. Records deleted with NO warning message.
    By evanscamman in forum Access
    Replies: 2
    Last Post: 12-14-2007, 11:18 PM
  4. Security Warning
    By mojo53777 in forum Security
    Replies: 0
    Last Post: 11-16-2007, 06:23 AM
  5. Inserting Picture in MS Access Message
    By wasim_sono in forum Programming
    Replies: 0
    Last Post: 01-17-2006, 03:46 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