C
Cris Biron
The following is a portion of code in a calendar form:
Private Sub Form_Close()
Dim strActiveObjectName As String
On Error GoTo ProcErr
strActiveObjectName = Application.CurrentObjectName & "_Form_Close"
If ctlThisControl.Name = "tckDate" Then
Forms!frmTickets.ctyIconLocNo.SetFocus
End If
If ctlThisControl.Name = "Event Date" Then
Forms![NEWfrmARKEvents Subform].SetFocus
End If
ProcExit:
Exit Sub
ProcErr:
DoCmd.Hourglass False
Application.Echo True
MsgBox "An error has occured in " & strActiveObjectName & ". @@" _
& "Error number " & Err.Number & ": " & Err.Description _
& vbCrLf & vbCrLf & "If this problem persists, note the error
message and " _
& "call your programmer.", , "Ooops . . . (unexpected error)"
Resume ProcExit
End Sub
"ctlThisControl" is the control for the calendar form. They may be
"tckDate" or "Event Date" on the forms "frmTickets" and "NEWfrmARKEvents
Subform" respectively.
The first IF .. THEN... block works well, that's it, when the calendar is
open from the first form/control, however, the second does not.
I get the following error:
"Error number 2450: Microsoft can't find the form " NEWfrmARKEvents Subform"
referred to in ... visual Basic code"
Anybody knows why this is happening or what is the solution?
Thanks,
cris biron
Private Sub Form_Close()
Dim strActiveObjectName As String
On Error GoTo ProcErr
strActiveObjectName = Application.CurrentObjectName & "_Form_Close"
If ctlThisControl.Name = "tckDate" Then
Forms!frmTickets.ctyIconLocNo.SetFocus
End If
If ctlThisControl.Name = "Event Date" Then
Forms![NEWfrmARKEvents Subform].SetFocus
End If
ProcExit:
Exit Sub
ProcErr:
DoCmd.Hourglass False
Application.Echo True
MsgBox "An error has occured in " & strActiveObjectName & ". @@" _
& "Error number " & Err.Number & ": " & Err.Description _
& vbCrLf & vbCrLf & "If this problem persists, note the error
message and " _
& "call your programmer.", , "Ooops . . . (unexpected error)"
Resume ProcExit
End Sub
"ctlThisControl" is the control for the calendar form. They may be
"tckDate" or "Event Date" on the forms "frmTickets" and "NEWfrmARKEvents
Subform" respectively.
The first IF .. THEN... block works well, that's it, when the calendar is
open from the first form/control, however, the second does not.
I get the following error:
"Error number 2450: Microsoft can't find the form " NEWfrmARKEvents Subform"
referred to in ... visual Basic code"
Anybody knows why this is happening or what is the solution?
Thanks,
cris biron