Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2012
    Posts
    6

    Function Requires Response After Each SQL Line

    The following code requires that I confirm a row of data will be added to the table. Is there any way to have the script confirm or skip confirmation and move to the next line?

    Function mcrINSERTINTO()

    DoCmd.RunSQL "INSERT INTO dbo_tbl_Language ( db_lang_row_id, db_lang_name, db_culture_identifier ) VALUES (1, 'English - US', 'en-US')"
    DoCmd.RunSQL "INSERT INTO dbo_tbl_Company_Config ( db_company_config_row_id, db_style_sheet, db_logo_file_name, db_logo_width, db_logo_height, db_platform_name ) VALUES (1, 'styles.css', 'bannerlogo.gif', 300, 65, 'Employee Survey')"
    DoCmd.RunSQL "INSERT INTO dbo_tbl_level_snapshot ( db_level_snapshot_row_id ) VALUES (1);"
    DoCmd.RunSQL "INSERT INTO dbo_tbl_level_snapshot_language ( db_level_snapshot_row_id, db_lang_row_id, db_level_snapshot_desc ) VALUES (1, 1, ""Corporate""); "
    DoCmd.RunSQL "INSERT INTO dbo_tbl_Levels ( db_Levels_row_id, db_Level_num, db_Levels_Snapshot_ID ) VALUES (1, 1, 1); "
    DoCmd.RunSQL "INSERT INTO dbo_tbl_Level_Language ( db_Level_lang_row_id, db_Levels_row_id, db_lang_row_id, db_Level_name ) VALUES (1, 1, 1, ""Corporate""); "



    End Function

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Use

    CurrentDb.Execute "INSERT...", dbFailOnError

    to run the SQL, or use DoCmd.SetWarnings, making sure to turn them back on at the end of the function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Unbelievable Response from Access
    By whistler in forum Queries
    Replies: 10
    Last Post: 01-26-2012, 12:55 PM
  2. Replies: 7
    Last Post: 04-11-2011, 03:58 PM
  3. Often get no response from access
    By Grooz13 in forum Access
    Replies: 6
    Last Post: 08-13-2010, 10:51 AM
  4. Slow Database Response
    By Nixx1401 in forum Access
    Replies: 3
    Last Post: 02-25-2010, 11:09 AM
  5. Design In-Line Function ???
    By caljohn527 in forum Queries
    Replies: 0
    Last Post: 01-28-2009, 03:48 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