Rabu, 30 November 2011

[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


__._,_.___
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