It opens once, but not again

joe789

Registered User.
Local time
Today, 10:04
Joined
Mar 22, 2001
Messages
154
Hi Folks,

Below is some code that is attached to a command button. It opens a certain file from Crystal Reports. It works just fine, however for whatever reason; it only opens the report once and will never open it again unless I close and exit out of Access. Any ideas.

Private Sub Command72_Click()

Call Shell("C:\Program Files\Seagate Software\Crystal Reports\crw32.exe C:\Documents and Settings\Administrator\Desktop\template.rpt", vbNormalFocus)

Application.FollowHyperlink "C:\Documents and Settings\Administrator\Desktop\template.rpt"
End Sub


Thank you very much,

Joe
 
Hey Joe,

I ran into a situation like this before. The culprit was that the user tried to run the sub again before shutting down the app. She agreed to always watch for that - my backup was going to be to research how to test to see if that certain app is open first, then proceed.

If that is not your situation then I bet it has something to do with the fact that the sub that calls the exe file never ends (until you shut down access - you can probably see it in your task manager, list of processes).

Try something like:
Set Application = Nothing
before the End Sub

Let me know,

-Sean
 

Users who are viewing this thread

Back
Top Bottom