If my report is not listed as a Class Object is my db corrupt?

  • Thread starter Thread starter Torgenation
  • Start date Start date
T

Torgenation

Here's what I am trying to do - I have a report that I'd like to be able to
run based on a low and high date range. I enter the two dates on my form
into text boxes. I was able to filter two other reports this way in the
command button that opens the report (Report_Blahblah.Filter = "[Complete By]
= #" & stDateLow & "# AND [Complete By] <= #" & stDateHigh & "#").

But in my new report this doesn't work. I get an Object Required error.
When I type Report_Blahblah and then the dot, VBA doesn't starting
Autofilling (like it's not an object), and from the VBA code window, Project
Explorer window, my report does not show as a Microsoft Class Object. In
fact most of my reports don't.

Is my database corrupted?
 
If the report's HasModule property shows as No (on the Other tab of the
Properties box, when viewing the properties of the report), attempting to
find Report_Blahblah won't work.

It is possible to use:
Reports!Blahblah.Filter = ...
Reports!Blahblah.FilterOn = True

However, it would be much more efficient to apply a WhereCondition to
OpenReport rather than to open the report, load its data, and then reload
the data again by applying a filter afterwards.

Here's an example:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Torgenation said:
Here's what I am trying to do - I have a report that I'd like to be able
to
run based on a low and high date range. I enter the two dates on my form
into text boxes. I was able to filter two other reports this way in the
command button that opens the report (Report_Blahblah.Filter = "[Complete
By]
= #" & stDateLow & "# AND [Complete By] <= #" & stDateHigh & "#").

But in my new report this doesn't work. I get an Object Required error.
When I type Report_Blahblah and then the dot, VBA doesn't starting
Autofilling (like it's not an object), and from the VBA code window,
Project
Explorer window, my report does not show as a Microsoft Class Object.
In fact most of my reports don't.
 
I checked and my report HasModule property was in fact 'no'. Couldn't I
just change that to 'yes'? I have never worked with that property before, so
am curious why some of my reports would have that set to 'yes', but most of
them 'no'.

I will try your solution, however.

Thanks so much - I feel like I might actually get this resolved.



Allen Browne said:
If the report's HasModule property shows as No (on the Other tab of the
Properties box, when viewing the properties of the report), attempting to
find Report_Blahblah won't work.

It is possible to use:
Reports!Blahblah.Filter = ...
Reports!Blahblah.FilterOn = True

However, it would be much more efficient to apply a WhereCondition to
OpenReport rather than to open the report, load its data, and then reload
the data again by applying a filter afterwards.

Here's an example:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Torgenation said:
Here's what I am trying to do - I have a report that I'd like to be able
to
run based on a low and high date range. I enter the two dates on my form
into text boxes. I was able to filter two other reports this way in the
command button that opens the report (Report_Blahblah.Filter = "[Complete
By]
= #" & stDateLow & "# AND [Complete By] <= #" & stDateHigh & "#").

But in my new report this doesn't work. I get an Object Required error.
When I type Report_Blahblah and then the dot, VBA doesn't starting
Autofilling (like it's not an object), and from the VBA code window,
Project
Explorer window, my report does not show as a Microsoft Class Object.
In fact most of my reports don't.
 
A report without a module is called a light-weight report. If you can keep
your reports lightweight, they will load (slightly) faster, use less memory,
and there's one less thing that can go bad (corrupt binary.)

So yes: you could give them a module, but using the Reports collection is
better.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Torgenation said:
I checked and my report HasModule property was in fact 'no'. Couldn't I
just change that to 'yes'? I have never worked with that property before,
so
am curious why some of my reports would have that set to 'yes', but most
of
them 'no'.

I will try your solution, however.

Thanks so much - I feel like I might actually get this resolved.



Allen Browne said:
If the report's HasModule property shows as No (on the Other tab of the
Properties box, when viewing the properties of the report), attempting to
find Report_Blahblah won't work.

It is possible to use:
Reports!Blahblah.Filter = ...
Reports!Blahblah.FilterOn = True

However, it would be much more efficient to apply a WhereCondition to
OpenReport rather than to open the report, load its data, and then reload
the data again by applying a filter afterwards.

Here's an example:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

Torgenation said:
Here's what I am trying to do - I have a report that I'd like to be
able
to
run based on a low and high date range. I enter the two dates on my
form
into text boxes. I was able to filter two other reports this way in
the
command button that opens the report (Report_Blahblah.Filter =
"[Complete
By]
= #" & stDateLow & "# AND [Complete By] <= #" & stDateHigh & "#").

But in my new report this doesn't work. I get an Object Required
error.
When I type Report_Blahblah and then the dot, VBA doesn't starting
Autofilling (like it's not an object), and from the VBA code window,
Project
Explorer window, my report does not show as a Microsoft Class Object.
In fact most of my reports don't.
 
Back
Top