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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing files

Status
Not open for further replies.

afig

Programmer
Nov 30, 2007
39
US
I'm attempting to populate a table with contents from a file. I could simply use:

Code:
DoCmd.TransferText acImportDelim, , "tblImportData", "C:\Payments20051012.txt", False
DoCmd.OpenQuery "qryName"
DoCmd.DeleteObject acTable, "tblImportData"

but I'm attempting to make this as dummy-friendly as possible. I'd like to have an input element quite similar to html's <input type="file">, so that a user can just click the button, browse for the file, and click submit.

How could I go about doing this?
 
Have a look at this:
thread702-1342596
 
I found the acCmdImport useful, but I'm unable to produce working script. I know I must be missing a few variables somewhere.

I keep getting "run-time error 2002". While searching msdn and the local help files I was unable to locate anything useful.
 
Please post all of the code in the procedure and mark the line that fails.
 
I figured it out. apparently since the 2007 upgrade they did away with that macro (I should've known better, knowing m$), acCmdImportAttach is what I needed.
 
is there some way to set import defaults, specifically field names and field types?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top