INSERT msgbox error

Posted on 2012-08-12
Last Modified: 2012-08-12

When I run the below it gives me an error as shown in the pic.  The names of the tables are correct.  Please let me know what is wrong.  thank you.

CurrentDb.Execute "SELECT import-CSM2.* INTO import-CSM2_temp FROM import-CSM2", dbFailOnError

Question by:pdvsa
    LVL 29

    Accepted Solution

    Because of the dash in your table name you need to enclose them in brackets.  Try this:
    SELECT [import-CSM2].* INTO [import-CSM2_temp] FROM [import-CSM2]

    Author Comment

    OK that worked.  I guess it is a NO NO to have a dash in a table name.  I assume that an underscore is better.  thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now