R
Rob Parker
I suspect that I'm missing something simple here, but I can't figure
out exactly what.
I have the following code in the Form_Error event of the menu form
(frmMenu) which is set to open automatically via Startup options.
This code catches the error when the back-end file is missing, and
runs the code in the ConnectLinks function to re-connect (includes
prompt to user for datafile). The reconnect is successful, but the
frmMenu does not open after the code runs. How can I get this to
happen?
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 0 'no error
Response = acDataErrContinue
Case 3024 'broken links
MsgBox "The back-end datafile cannot be found.", , ""
ConnectLinks
Response = acDataErrContinue
Case 2580 'incorrect table(s)
Response = acDataErrContinue
MsgBox "The selected back-end datafile does not contain the
correct tables.", , ""
If Not ConnectLinks Then DoCmd.Quit
Case Else
Response = acDataErrDisplay
End Select
End Sub
There is other code in the Form-Open event (with error trapping), but
this is not causing the form to fail to open; a Msgbox statement as
the first executable line fails to run (even with error-trapping
turned off).
What am I missing?
TIA,
Rob
out exactly what.
I have the following code in the Form_Error event of the menu form
(frmMenu) which is set to open automatically via Startup options.
This code catches the error when the back-end file is missing, and
runs the code in the ConnectLinks function to re-connect (includes
prompt to user for datafile). The reconnect is successful, but the
frmMenu does not open after the code runs. How can I get this to
happen?
Private Sub Form_Error(DataErr As Integer, Response As Integer)
Select Case DataErr
Case 0 'no error
Response = acDataErrContinue
Case 3024 'broken links
MsgBox "The back-end datafile cannot be found.", , ""
ConnectLinks
Response = acDataErrContinue
Case 2580 'incorrect table(s)
Response = acDataErrContinue
MsgBox "The selected back-end datafile does not contain the
correct tables.", , ""
If Not ConnectLinks Then DoCmd.Quit
Case Else
Response = acDataErrDisplay
End Select
End Sub
There is other code in the Form-Open event (with error trapping), but
this is not causing the form to fail to open; a Msgbox statement as
the first executable line fails to run (even with error-trapping
turned off).
What am I missing?
TIA,
Rob