Import file after selection from dialog box

G

Guest

I have figured out how to open a dialog box to allow the user to browse for a
file, but now I want Access 2000 to import that file using an import
specification to an existing table. I have the code below to open the dialog
box - how do I now import that file selected by the user?

Private Sub cmdFileDialog_Click()

Dim strFilter As String
Dim strInputFileName As String

strFilter = ahtAddFilterItem(strFilter, "Tab Files (*.tab)", "*.tab")
strInputFileName = ahtCommonFileOpenSave( _
Filter:=strFilter, OpenFile:=True, _
DialogTitle:="Please select an input file...", _
Flags:=ahtOFN_HIDEREADONLY)
End Sub
 
G

Guest

Douglas,

I am green when it comes to VB code. I know I need to use the transfertext
method, but I could use the code the cuold accomplish that. If you can point
me in the direction where to get that coe, that would be great..
 
A

Arvin Meyer [MVP]

With a database open, if you press F1, click on the Index tab, then type:
"TransferText" without the quotes, you should get to a help item which will
explain and give you a good example of how to use TransferText.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top