• Inserting data into a table

    Author
    Topic
    #353718

    Background:
    I am using Office 2000 and I’m pretty new to Access 2000 VBA section.
    I have a batch of data in an Excel spreadsheet, which I want to place into an Access Table.

    In Access, I have got the code correct to gain access to the data in the spreadsheet and a SQL command to enter the data into the table. The SQL command is as follows:

    DoCmd.RunSQL “INSERT INTO PersonalAdvices (xxx, yyy, zzz) VALUES (xxx, yyy, zzz)” , A_NEWREC
    (Or some syntax very close to it – either way, it works)

    Problem:
    It requests a Yes/No confirmation for each record that is being inserted.

    Question:
    Is there a way to suppress/bypass/set the Yes/No confirmation? Or is there another method, which does the same thing?

    (There are over 1300 records, which will be needed to be inserted into the table).

    Thanks for the help so far!

    James

    Viewing 0 reply threads
    Author
    Replies
    • #518021

      docmd.setwarnings false
      DoCmd.RunSQL “INSERT INTO PersonalAdvices (xxx, yyy, zzz) VALUES (xxx, yyy, zzz)” , A_NEWREC
      docmd.setwarnings true

      • #518022

        Thanks for the quick reponse and the code!

        It will work perfectly – thanks!

        (And I can’t believe that its so simple and that I missed it!)

        James

    Viewing 0 reply threads
    Reply To: Inserting data into a table

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: