If unbound list box in report is blank then don't show report deta

T

Timmy

I have a report that has several unbound list boexs. If one specific list box
in blank I don't want to show report detail
 
J

Jeff Boyce

Timmy

If the listbox is blank (?empty), how did it get that way? You mentioned
that it is unbound, so there's no underlying field or query that feeds it,
right?

I'm guessing from what you didn't say that you have a procedure in the
OnFormat or OnPrint event that specifies what's to show in that listbox.
Why not check, in the code right then, and react accordingly, instead of
waiting for the report's listbox to fill and trying to check it?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

Timmy

It's a report that summarizes info from 6 separate tables (Regions, accounts,
facilities, etc.). All tables have a Yes/No check box. If none of check boxes
in the Region table is checked then the Regions list box in the Report is
blank. If that's the case I don't want to show the Report Detail.
 
J

Jeff Boyce

If the listbox is unbound, how does it know to be blank?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
T

Timmy

The Report is not based on any table or qry. The list box is unbound to a
report, but bound to a table called Regions that has a Region ID and Yes/No
checkbox. If none of check boxes are selected (which means none of the
Regions are selected) then the list box is blank.

Thank you
Tim
 
J

Jeff Boyce

Tim

I suspect we're having a discussion about semantics.

Access reports can have unbound controls on them. Those controls do not
have a field/data source that comes from a query or a table. A listbox is a
useful control ... on a FORM, in which you can use the listbox to select an
item.

Reports are intended for print-out purposes, so putting a listbox on a
report doesn't make much sense (you can't select an item on a paper report
and expect anything to happen <g>).

"How" depends on "what", and I still don't understand the "what" ... what
data structure does your [Regions] table have? Are you saying that there
are only two fields, [RegionID] and [Yes/No]?

Are you saying you want to see which regions are marked "Yes"? You can do
that with a query. I suppose you could even use that query as the data
source for a listbox control in a report (but this is, again, not the
standard, recommended usage of a listbox control).

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top