run saved IMPORT specification from a button in a form

J

JeffSomDal

I need to run a saved IMPORT specification from a button in a form. How is
this possible?

I was able to run an EXPORT "specification" from a button in a form by using
an embedded macro throught the RunMacro action. The macro leveraged the
'OutputTo' action where I was able to define all the necessary parameters.
 
C

Chris O'C via AccessMonster.com

Don't use macros, use vba code. Transfertext will import or export a text
file with saved specifications.

Private Sub cmdImport_Click()
On Error GoTo Proc_Err

DoCmd.TransferText acImportDelim,"Monthly_Import_Spec","tblMonthly", _
"c:\data\sept08.csv"
Exit Sub

Proc_Err:
MsgBox Err.Number & vbCrLf & Err.Description
Err.Clear
End Sub

See TransferText in the help file for all the options.

Chris
Microsoft MVP
 
K

Klatuu

First, you should not be using the Output To. You would be better off
using the the TransferText action in your macro. It has a box for you to
enter the Import Spec name in.
 

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