Results 1 to 4 of 4
  1. #1
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    101

    VBA that imports excel data into table and deletes previous data


    I'm looking for help for writing a code that prompts the user to select a CSV file, which will import that file into a table. I also need the code to delete the data that was previously in the table. If anyone has any articles or youtube tutorials for writing this code, I'd greatly appreciate it. I can't seem to find any that show how to have the VBA run a delete query prior to importing the data.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    15,455
    Have you tried using Google/Bing to find information?
    try this string ms access example selecting and importing a csv

    Delete current records in table

    Code:
    Delete * From Tablename;

  3. #3
    templeowls is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2019
    Posts
    101
    I have but I've yet to find a tutorial that includes both import steps along with deletion steps. I'm honestly very new to VBA in access and following tutorials is how I've been self-learning. I was hoping someone knew of any Youtube ones. I'll try the string...Thanks!

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    15,455

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

Similar Threads

  1. Replies: 1
    Last Post: 08-13-2018, 12:00 PM
  2. Replies: 39
    Last Post: 03-15-2017, 07:34 PM
  3. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  4. Importing Data from excel deletes queries
    By piyush85 in forum Access
    Replies: 5
    Last Post: 08-08-2011, 12:33 PM
  5. Access Report deletes grouped data.
    By matt123 in forum Database Design
    Replies: 5
    Last Post: 07-07-2011, 09:19 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 - Senior Forums