Error with DoCmd.RunSavedImportExport (1 Viewer)

bob fitz

AWF VIP
Local time
Today, 19:36
Joined
May 23, 2011
Messages
4,719
Using Access 2016
Code:
DoCmd.RunSavedImportExport "UpdateCo"
Anybody know why this line of code would cause the following error:
Run-time error '31602':

The specification with the specified index does not exist. Specify a different index. 'UpdateCo'.
 

Minty

AWF VIP
Local time
Today, 19:36
Joined
Jul 26, 2013
Messages
10,371
According to the help it might mean that the specification has been deleted ?

If you have saved it, and I'll assume you have, try renaming it?
 

bob fitz

AWF VIP
Local time
Today, 19:36
Joined
May 23, 2011
Messages
4,719
Thanks for you interest Minty but renaming it to AA produced the same error :(
 

Minty

AWF VIP
Local time
Today, 19:36
Joined
Jul 26, 2013
Messages
10,371
Hmmm - interesting "feature" .
I assume if you manually run the saved import / export through the menu it works fine.

There is a really cryptic bit of text on the microsoft site https://support.office.com/en-us/ar...o-action-41c366d8-524e-4c7e-847d-c2cf7abb2049 near the bottom it says;
If the saved import or export specification you choose for the Saved Import Export Name argument is deleted after the macro is created, Access displays the following error message when the macro is run:

The specification with the specified index does not exist. Specify a different index. 'specification name'.

I can't work out if they are being slightly sarcastic with that text, or really think that it helps?
 

bob fitz

AWF VIP
Local time
Today, 19:36
Joined
May 23, 2011
Messages
4,719
Thanks for your input and time Minty. After reading what you'd quoted from the site I decided to delete my saved export and then recreate it. It was then that I realised the mistake I was making. Instead of using the correct name I was using the description as the parameter.

I feel a bit embarrassed for making such a silly mistake :eek:. Thanks again for your interest and help. My apologies for wasting your time.
 

Minty

AWF VIP
Local time
Today, 19:36
Joined
Jul 26, 2013
Messages
10,371
No problem at all.

I just spent well over an hour wondering why I was getting duplicates in a Union query, until I twigged the data I thought I was filtering out in part 1 of the union wasn't being filtered at all...

I love Monday's :)
 

esun136

New member
Local time
Today, 11:36
Joined
Aug 1, 2019
Messages
2
Thanks for your input and time Minty. After reading what you'd quoted from the site I decided to delete my saved export and then recreate it. It was then that I realised the mistake I was making. Instead of using the correct name I was using the description as the parameter.

I feel a bit embarrassed for making such a silly mistake :eek:. Thanks again for your interest and help. My apologies for wasting your time.


Hi, Bob.

I'm new to Access and VB. I've encountered the same error msg when running "DoCmd.RunSavedImportExport ("Import-FCR_LABOR_COST_SUMMARY1")". Both the source and target tables do not require index.

Not quite understand your msg on how to fix this. Would you please explain again? and provide the correct code? Thanks.
 

Users who are viewing this thread

Top Bottom