问题描述:

I'm new to Access VBA, but I have managed to create a specification for my DB to import a txt and this works when being used manually, but fails when used in the following VBA. When I say fails, I mean it's as if there is no specification used, but the import "works", it just brings in a big mess, but the "correct" data.

Private Sub Command2_Click()

DoCmd.TransferText acImportDelim, "Specification what I Made", TableName, FilePath & Filename, False

End Sub

I've been through everything I can think of, but I'm stuck.

Can anyone help?

网友答案:

Although it feel a little like I'm talking to myself here, the answer was:

DoCmd.TransferText acImportDelim,

Should have read

DoCmd.TransferText acImportFixed,

Obviously.

相关阅读:
Top