Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a real quick question 1

Status
Not open for further replies.

mrwendell

Programmer
Aug 22, 2003
43
US
if i turn off break on all errors...other than my users won't see a access generated error msg just my custom msgboxes...is there anything else i should be aware of?
 
You have to select one of the three options. I usually leave it on Break on Unhandled Errors, only changing the setting when I'm debugging. Unfortunately, none of the options will stop all errors - if you don't trap them, you will crash and your user will be unceremoniously dumped out (MDE/ADE/runtime), or let loose on your source code (MDB/ADP).
 
thanks norris68...you were right i have to select one of them...so i tried "them all" and they won't show the sys msg but it wont allow me to continue either. maybe you have a better solution to this...the err is 2501--cancel openform method

i have an inputform asking for [ssn] based on that [ssn] it will open form2 to that record on tblemp...currently if a user puts in any 9digits it will open a blank form...so i entered the following code on the inputform:
Private Sub CONTINUE_Click()
On Error GoTo Err_CONTINUE_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmRDM"
stLinkCriteria = "[SSN]=" & "'" & Me![SSN] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Me.Visible = False
Exit_CONTINUE_Click:

SSN.SetFocus
Exit Sub
Err_CONTINUE_Click:

'MsgBox Err.Description ' I COMMENTED THIS OUT THINKING IT WAS THE SOLUTION
Resume Exit_CONTINUE_Click

End Sub

and then on the MAINFORM i put this on ON OPEN EVENT:

Private Sub Form_Open(cancel As Integer)

If IsNull(SSN) Then
MsgBox "YOU MUST ENTER A VALID SSN!", vbExclamation
cancel = True

Else

Calendar5.Visible = False

End If

End Sub

i simple donot want my users to see the sys err msg only my msgbox and then return to the inputform for another try...this has got to be a simple step...HEELLLPPP!
 
You seem to be on the right lines. I would leave the break option set to Unhandled Errors. Break on All Errors will break whether you have an error handler or not. Break in Code Module will break before the error percolates up the call stack. Break on Unhandled Errors will break if it doesn't encounter an error handler before reaching the top of the call stack.

Are you sure your existing code doesn't work with BoUE?
 
thanks norris68....not sure why it didn't work the first time but i did check :"break on unhandled errors"...it worked...then got the message err.description box...which i commented out works fine...thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top