G
gregboyer
I'm a brand new Access user, and trying to set up a form to collect
parameters for a report that I want to run. I've been going through
the online help for Access 2007, and have followed all of the steps as
best as I can. It told me to create a module to check whether a form
is already open, and to paste the code into the Visual Basic editor. I
can get the form to come up and accept the parameters, but when I click
"Ok," I get an error that says,
"Run Time Error 2467. The expression you entered refers to an object
that is closed or doesn't exist."
Here's the code for the module I was instructed to create.
Function IsLoaded(ByVal strFormName As String) As Boolean
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
End Function
Any idea what step or what it is that I'm missing?
Thanks!
parameters for a report that I want to run. I've been going through
the online help for Access 2007, and have followed all of the steps as
best as I can. It told me to create a module to check whether a form
is already open, and to paste the code into the Visual Basic editor. I
can get the form to come up and accept the parameters, but when I click
"Ok," I get an error that says,
"Run Time Error 2467. The expression you entered refers to an object
that is closed or doesn't exist."
Here's the code for the module I was instructed to create.
Function IsLoaded(ByVal strFormName As String) As Boolean
Dim oAccessObject As AccessObject
Set oAccessObject = CurrentProject.AllForms(strFormName)
If oAccessObject.IsLoaded Then
If oAccessObject.CurrentView <> acCurViewDesign Then
IsLoaded = True
End If
End If
End Function
Any idea what step or what it is that I'm missing?
Thanks!