J
Jessie
Hello.
I have an automated process thatexports three tables as
text then Calls a batch file that merges 3 files and names
it Sales.txt. I then have to pull a control off of a field
in my form and rename that file accordingly. It works
great except sometimes the batch file isn't fast enough
for the code and I will get an error saying the Sales.txt
does not exist. Here's what I have:
With DoCmd
..TransferText
acExportFixed, "EOFExp", "tblEOF", "C:\Alltel\EOF.txt"
..TransferText
acExportFixed, "HeaderExp", "tblHeader", "C:\Alltel\Header.
txt"
..TransferText
acExportFixed, "TransExp", "tblTransfer", "C:\Alltel\Transf
er.txt"
Dim stName As String
stName = "C:\Alltel\Merge.bat"
Call Shell(stName, 1)
Dim txtcontact As Control
Set txtcontact = Forms!CSR_Input![SalesLeadID]
Name "C:\Alltel\sales.txt" As txtcontact & ".TFR"
End With
Where I have the Name command is where it will sometimes
error out saying that Sales.txt does not exist. I am
pretty sure it is a timing thing.
Is there a way to pause the code to make access wait
before trying to rename the file?
Thanks,
Jessie
I have an automated process thatexports three tables as
text then Calls a batch file that merges 3 files and names
it Sales.txt. I then have to pull a control off of a field
in my form and rename that file accordingly. It works
great except sometimes the batch file isn't fast enough
for the code and I will get an error saying the Sales.txt
does not exist. Here's what I have:
With DoCmd
..TransferText
acExportFixed, "EOFExp", "tblEOF", "C:\Alltel\EOF.txt"
..TransferText
acExportFixed, "HeaderExp", "tblHeader", "C:\Alltel\Header.
txt"
..TransferText
acExportFixed, "TransExp", "tblTransfer", "C:\Alltel\Transf
er.txt"
Dim stName As String
stName = "C:\Alltel\Merge.bat"
Call Shell(stName, 1)
Dim txtcontact As Control
Set txtcontact = Forms!CSR_Input![SalesLeadID]
Name "C:\Alltel\sales.txt" As txtcontact & ".TFR"
End With
Where I have the Name command is where it will sometimes
error out saying that Sales.txt does not exist. I am
pretty sure it is a timing thing.
Is there a way to pause the code to make access wait
before trying to rename the file?
Thanks,
Jessie