Kamis, 01 Desember 2011

RE: [MS_AccessPros] Re: Run-Time error '2501'

 

Thomas-

You would have set Break on All Errors if you were doing some tedious debugging.
Yes, that setting will ignore On Error.

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Thomas
Sent: Thursday, December 01, 2011 6:55 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Run-Time error '2501'

Hey John,

You are right on. It was working OK at some point in time and I don't remember
changing any of the setting.

So the 'Break on all errors' will overwrite the 'Resume Next' or presumably for
all 'On errors' statement.

Thanks again and appreciate your insight .

Thomas

--- In MS_Access_Professionals@yahoogroups.com, "John Viescas" <john@...> wrote:
>
> Thomas-
>
> That code looks fine, but I bet you set "Break on all Errors" in the VB Editor
> Tools / Options.
>
> John Viescas, author
> Microsoft Office Access 2010 Inside Out
> Microsoft Office Access 2007 Inside Out
> Building Microsoft Access Applications
> Microsoft Office Access 2003 Inside Out
> SQL Queries for Mere Mortals
> http://www.viescas.com/
> (Paris, France)
>
>
>
> -----Original Message-----
> From: MS_Access_Professionals@yahoogroups.com
> [mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of Thomas
> Sent: Thursday, December 01, 2011 1:48 AM
> To: MS_Access_Professionals@yahoogroups.com
> Subject: [MS_AccessPros] Run-Time error '2501'
>
> Screen displays the following 2 messages. This is happening in MS Office 2007.
>
> Run-time error '2501'
> The OpenForm Action was cancelled.
>
> Where the following code is triggered.
>
> Private Sub ROUTINGID_DblClick(Cancel As Integer)
> Dim stDocName As String
>
>
> stDocName = " Control_All_Form "
>
> On Error Resume Next
>
> DoCmd.OpenForm stDocName, acNormal, , , , , "1" & "|" & Me.ROUTINGID & "|"
>
>
> Error_exit:
>
> Exit Sub
> End Sub
>
>
> Private Sub Form_Open(Cancel As Integer)
> Dim rs As Object
> Dim OpenArg_Txt, varArray As Variant
> Dim intI As Integer
> ...
> .
> .
> If Ltotal = "0" Then
> NRF = "No record found "
> If MsgBox(NRF, vbOKOnly) = vbOK Then
> Cancel = True
> End If
>
>
> GoTo Exit_Form_Open
>
> End If
> ....
> .
> .
> Exit_Form_Open:
> Exit Sub
> End Sub
>
>
> Can't figure out why the 'Resume Next' was not triggered at all. It always
> stopped at the DoCmd.
>
> Debug shows cancel is = 0 when the code failed at the DoCmd.
>
> Any help is appreciated.
>
> Regards,
> Thomas
>
>
>
>
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>

------------------------------------

Yahoo! Groups Links

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar