View Single Post
  #28  
Old January 1st, 2009, 01:14 PM posted to microsoft.public.access,microsoft.public.access.forms,microsoft.public.access.modulescoding
Andy[_11_]
external usenet poster
 
Posts: 48
Default A2K Runtime Crashes on DoCmd.Quit

Tony;

Thank You for Your replies.

At first the full code (Included Below) wasn't included because I didn't
want to make You kind people read a lot of redundancies.

The Error Traps have been in place since the app was originally created.
Each trap does 2 things. Shows the Access Internal Error msg and displays
the name of the Command that failed.
Neither displays any message.
All that shows is:
"Execution of this application has stopped due to a run-time error."
"The application can't continue and will be shut down."

As for Your other reply:

"I've remove the last reference, VBA for Extensibility.. It's
automatically inserted by Access when you convert a database to a
newer version. Although that could've been from A97 to A2000 or
something like that. IOW quite a while ago."

The application was started and completed in Office Developer 2000 using
Access 2000.
So it has never been brought forward from an older version of Access.
We did re-install the app once before on the same computer. The machine was
"Rebuilt" from scratch about a year ago.

Tony, one last thing. What is "IOW"?

Andy

Full Code for both Commands in frmLogin

Private Sub cmdExit_Click()
On Error GoTo Err_cmdExit_Click
Dim Msg, Style, Title, Help, Ctxt

DoCmd.Quit

Exit_cmdExit_Click:
Exit Sub

Err_cmdExit_Click:
Msg = MsgBox("Either:" & vbCrLf & Error$ & vbCrLf & vbCrLf & _
"Or this command ''cmdExit_Click'' doesn't understand Your input. "
& vbCrLf & _
" Click the OK button" & vbCrLf & _
" Try the steps again." & vbCrLf & _
" If You Need Help, click the OK button then press the F1 key.",
vbOKOnly + vbCritical, "OurCompany")
Resume Exit_cmdExit_Click
End Sub

Private Sub cmdLogin_Click()
On Error GoTo Err_cmdLogin_Click
Dim strInput As String
Dim Msg, Style, Title, Help, Ctxt

If Me![txtPwordAsk] = (DLookup("[MyPWord]", "tblMain")) Or
Me![txtPwordAsk] = "*SpecialPWord*" Then
DoCmd.OpenForm "frmMain"
DoCmd.Close acForm, "frmLogin"
Else
Msg = MsgBox("That is not the correct Password." & vbCrLf & _
"Please enter the Password once more.", vbOKOnly + vbInformation,
"OurCompany")
Me![txtPwordAsk] = Null
Me![txtPwordAsk] = Null ' Don't know why this line is here twice.
DoCmd.GoToControl "txtPwordAsk"
End If

Exit_cmdLogin_Click:
Exit Sub

Err_cmdLogin_Click:
Msg = MsgBox("Either:" & vbCrLf & Error$ & vbCrLf & vbCrLf & _
"Or this command ''cmdLogin_Click'' doesn't understand Your input. "
& vbCrLf & _
" Click the OK button" & vbCrLf & _
" Try the steps again." & vbCrLf & _
" If You Need Help, click the OK button; then press the F1 key.",
vbOKOnly + vbCritical, "OurCompany")
Resume Exit_cmdLogin_Click
End Sub

"Tony Toews [MVP]" wrote in message
...
"Andy" wrote:

Already using that code.


Actually you're not based on your initial posting. Gina's code has
the error handling in it. Which, if inserted in the may give us a
better error message.

It doesn't generate an Error Message. Just gets a RunTime Crash.


By runtime crash you mean
"Execution of this application has stopped due to a run-time error."
"The application can't continue and will be shut down."

If so inserting the error handling as per Gina's suggestion will
likely result in a more meaningful message.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/