Import a dbf file

Sezzy

Registered User.
Local time
Today, 04:48
Joined
Nov 3, 2004
Messages
19
I'm trying to import a file that is in a dbf format. The code I'm using at the moment is:

fname = Me.filename
tblname = Me.filename

Set db = CurrentDb

Path = "Q:\HH Survey DataPool 2005\PPS\"

ImportNew:
DoCmd.TransferText acImport, , tblname, Path & fname & ".dbf"

This brings up an error saying the object is read only, but the file isnt because I can import manually alright.

Please help. Thanks
 
Code to import a dBase IV dbf table into Access 2000:-
Code:
   Dim fname As String
   Dim tblname As String
   Dim path As String
   
   fname = Me.filename
   tblname = Me.filename

   path = "C:\My Documents\"

   DoCmd.TransferDatabase acImport, "dBase IV", _
      path, acTable, fname & ".dbf", tblname
.
 
Thank you very much. That did the trick!!
 

Users who are viewing this thread

Back
Top Bottom