Hi,
I have spent 30 minutes searching google and come up with nothing. I have a command button on an Access form with the following event procedure. It will work the first time I click it, but it won't work again until I click another command, and then go back to this button.
I have tried clearing the variables a bunch of different ways, but perhaps not the right way? I have tried err.clear at the end, to see if it thought the command already finished successfully. I have looked around for some kind of VBA statement that resets a routine. And I have even tried calling another bogus subroutine right before this one ends. No joy... Any help would be appreciated.
Thanks, Colin.
Private Sub Command84_Enter()
Dim stappname As String
Dim fyear As String
Dim fname As String
fyear = InputBox("Enter the desired 4 digit year", "Which year?")
fname = "msaccess.exe M:\Materials\Purchasing\Inventory\CYCLECOUNTS\ABC\" & fyear & "ABC\" & fyear & "ABC.MDB"
stappname = fname
Call Shell(stappname, 3)
End Sub
I have spent 30 minutes searching google and come up with nothing. I have a command button on an Access form with the following event procedure. It will work the first time I click it, but it won't work again until I click another command, and then go back to this button.
I have tried clearing the variables a bunch of different ways, but perhaps not the right way? I have tried err.clear at the end, to see if it thought the command already finished successfully. I have looked around for some kind of VBA statement that resets a routine. And I have even tried calling another bogus subroutine right before this one ends. No joy... Any help would be appreciated.
Thanks, Colin.
Private Sub Command84_Enter()
Dim stappname As String
Dim fyear As String
Dim fname As String
fyear = InputBox("Enter the desired 4 digit year", "Which year?")
fname = "msaccess.exe M:\Materials\Purchasing\Inventory\CYCLECOUNTS\ABC\" & fyear & "ABC\" & fyear & "ABC.MDB"
stappname = fname
Call Shell(stappname, 3)
End Sub