Results 1 to 6 of 6
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    How to turn off prompt when running append query from code

    I'm writing an import function in one of my apps. Table rows are being added my the 100's. How do I turn off the prompt when each row is to be created"

    Click image for larger version. 

Name:	RowPrompt.jpg 
Views:	2 
Size:	33.7 KB 
ID:	13156



    Here's the 1st of the SQL command strings:

    Click image for larger version. 

Name:	AppendSQL.jpg 
Views:	3 
Size:	27.5 KB 
ID:	13158

    Good grief! How do I get insert image to display the images at their actual size?

  2. #2
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Here's the first of many SQL statements, as copied from the immediate window (debug.print):

    INSERT INTO Registry([FamilyID], [RegAs], [LastName], [FamilySort],[FirstName],[Address],[CityState],[Zip],[Select])Values(850, "Spouse","","2","Bev","80065 North Street","Scottsbluff, NE","69361-5739"," ")

  3. #3
    nigelbloomy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Posts
    51
    If you are running this query from a macro or VBA code you can add the line DoCmd.SetWarnings False just before the query starts and then put DoCmd.SetWarnings True just after the query runs.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Alternatively, use the more efficient Execute method:

    http://www.baldyweb.com/SQLWarnings.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Thanks, that cleared up the issue.
    Bill

  6. #6
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Hi Paul,

    I had already noticed that I should be using CurrentDb.Execute. Since I had made both changes at the same time, DoCmd.SetWarnings and CurrentDb.Execute, I didn't realize that using CurrentDb.Execute would run without the warnings anyway.

    As an aside, what is the answer to my question about displaying images at their original size?

    Bill
    (PS) HOT HOT HOT!!!!

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

Similar Threads

  1. Running Code from a Module in a Macro
    By ReadyReckoners in forum Modules
    Replies: 2
    Last Post: 05-08-2013, 04:45 AM
  2. Turn off busy icon when performing Query
    By robrich22 in forum Access
    Replies: 1
    Last Post: 03-07-2013, 09:19 PM
  3. Replies: 1
    Last Post: 12-13-2012, 01:41 PM
  4. running append query without showing some alertes
    By afshin in forum Programming
    Replies: 2
    Last Post: 11-10-2012, 10:49 AM
  5. Prompt User for Date Range when running QUERY
    By taimysho0 in forum Programming
    Replies: 3
    Last Post: 01-30-2012, 11:49 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