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

Run time error 3001 Invalid Argument when using DoCmd.Transfertext

Status
Not open for further replies.

hedgracer

Programmer
Mar 21, 2001
186
US
I have the following VBA code:

Dim dkg As Variant, str As String
dkg = Application.FileDialog(msoFileDialogFilePicker).Show
str = Application.FileDialog(msoFileDialogFilePicker).SelectedItems(1)

DoCmd.TransferText acImportDelim, "OnyxSRImportSpecification", "Onyx_Allocation_Import", _
str, False

Here is the data I am trying to import:

RCG,Onyx,&70670637,706JAY,359,11/17/2011,12/31/2012,12/31/2012,NO,NO

Onyx_Allocation_Import is a table in SQL Server 2008 R2 and is a linked table. The import specification is delimited using .csv. All fields in the table are Varchar(50) and the table fields in Access show up as Text.

Every time I try to import this row I get the following error message:

Run-time error '3001':

Invalid argument.

I have tried several suggestions found on Goggle with no success (setting all fields to varchar, adding false at the end of the docmd). Does anyone have any suggestions?

Thanks for any help in advance.

Dave
 
But it will import other rows successfully? If so, my guess is that it is the & which Access is going to interpret as code. Is the data enclosed in quote marks or is it as shown? If you can bracket the text with quote marks it might help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top