Results 1 to 2 of 2
  1. #1
    wycliffslim is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2015
    Posts
    1

    VBA Commands To Import DBF Files Into A New Table

    I've been creating an automated way for users to import an existing DBF III file into an Access Table and then I'll be doing some other things after it's in. The user needs to be able to click a command button to open up a file picker, select the desired DBF and then click import and have it be imported into a new table.



    Originally I had this all working because there was only one possible file name for the DBF file in each folder so instead of using a file picker I used a folder picker and supplied the file name in the VBA code as it was static.

    However, I now need the user to be able to select a specific file and the name could be anything.

    I've successfully edited the file picker to allow them to select a file however the importing is an issue. In order to do a TransferDatabase command I need the file path alone for DatabaseName and the file name alone for Source.

    What would be the best way to split those two pieces of data up once the user has selected the file they need?

    Thanks in advance for any help.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Once you have the full path and filename from the file picker, use InStrRev() to get the position of the last "\", then use the Left() and Right() functions to get only the path and the only the filename.

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

Similar Threads

  1. Browse to import *.txt or *.xls files into table
    By Dirtpics in forum Import/Export Data
    Replies: 2
    Last Post: 06-18-2014, 10:25 AM
  2. Replies: 1
    Last Post: 03-25-2014, 08:54 PM
  3. Replies: 7
    Last Post: 11-20-2012, 05:08 PM
  4. Replies: 1
    Last Post: 06-27-2012, 07:39 AM
  5. Import multiple dbf files into existing table?
    By sbg2 in forum Import/Export Data
    Replies: 0
    Last Post: 06-12-2006, 02:06 PM

Tags for this Thread

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