Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA FORM ACTIVE X - File Import dBASE III

Status
Not open for further replies.

jwkolker

Programmer
Jan 9, 2003
68
US
This code almost works only its pulling a type mismatch error - it is an activeX form that allows the user to browse to a file and then have the file name and path changed to a string and then used in transferdatabase routine - take a peek and recommend where I may have to tweeeek something please:
Code:
Private Sub cmdBrowse_Click()

'setup declarations
Dim strFile As String
Dim CurrentFile As String
Dim Path As String

On Error GoTo Closeit:
DoCmd.SetWarnings False
'use active x file open object
    With Me.cdlgopen
        .CancelError = True
        .Filter = "dBASE Files (*.dbf)"
        .ShowOpen
        strFile = .FileName
        CurrentFile = strFile
     
        DoCmd.TransferDatabase acImport, "dBASE III", strFile, acDefault, "Vendpay"
        
        
   MsgBox "This file was just imported successfully - " & strFile, vbInformation, "Done..."

DoCmd.SetWarnings True
DoCmd.Close acForm, "f-getfundfile"
Exit Sub

Closeit:
DoCmd.Close acForm, "f-getfundfile"
MsgBox "No File was imported!", vbCritical, "Uh-Oh......"

End With
End Sub
Private Sub Close_Click()
On Error GoTo Err_Close_Click


    DoCmd.Close

Exit_Close_Click:
    Exit Sub

Err_Close_Click:
    MsgBox Err.Description
    Resume Exit_Close_Click
    
End Sub




John Kolker
Programmer
jwkolker@comcast.net
 
DoCmd.TransferDatabase acImport, "dBASE III", strFile, acDefault, "Vendpay"


John Kolker
Programmer
jwkolker@comcast.net
 
expression.TransferDatabase(TransferType, DatabaseType, DatabaseName, ObjectType, Source, Destination, StructureOnly, StoreLogin)

DoCmd.TransferDatabase acImport, "dBASE III", strFile, acDefault, "Vendpay"

strfile is supposed to a directory. Is it?
Vendpay is supposed to be a dbf. Is it?
No target table is supplied.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top