Hi Guys,
I have saved a import for stock taking, that looks for : C:\[Folder]\StockImport.xlsx and is saved as StockImport:
Behind a button action, this saved import called:
Code:
Private Sub cmdUpdateStock_Click()
MsgBox " You are about to run update script to imorted and update stock values, do you wish to continue?", vbYesNo, "Import Stock Take"
DoCmd.RunSavedImportExport ("StockImport")
DoCmd.OpenQuery ("qrySTK01ItemsToUpdate"), acViewPreview
MsgBox "Your Stock has been added to Import Table, do you wish to apply the update?", vbYesNoCancel, "Update Stock Values"
DoCmd.SetWarnings False
DoCmd.OpenQuery ("qryUpdateStockTake")
DoCmd.OpenQuery ("qrySTK01ImportUpdateAudit")
DoCmd.SetWarnings True
Me.Refresh
End Sub
This has worked for a while, but recent testing after a reported issue this now errors when calling the RunSavedImportExport, saying it cannot be found.
If I try and run via the saved imports it throws another error, with the word 'Export' :
I do have some exports defined, on the export tab and they work fine, so not sure even where to look at this.
If I recreate the import, it saves and works, but if it breaks on a deployed version, I would have to issue another update!
So 2 questions:
1. Any idea why it cant find the defined saved task?
2. Are there better ways to complete this process?
Thanks in advance.