Deleting Fields From Report Programmatically

A

Alan B. Densky

I have an A 2000 database with a unique report. Each time the report is
run, it only displays data from one record in the table. It has dozens of
uniquely named fields, placed in a vertical column, in the detail area.
When the value in a field is zero, I would like to eliminate that field from
the column on the report, and have all of the fields beneath it move up to
close up the vertical gap(s) left open by the fields that have been
eliminated from the report.

Of course it's easy to loop through all of the fields with a zero value, and
make those fields invisible. But how can I make each zero value field, and
all of the fields beneath it in the column, move up to close up the gap(s)
created by the invisible fields?

Anyone have any ideas on this one?

Alan B. Densky
 
D

Duane Hookom

You can change your properties to something like:
Name: txtField1
Control Source: =IIf([Field1]=0,Null,[Field1])
Can Shrink: Yes

Also set the section Can Shrink to Yes.
 
A

Alan B. Densky

Duane,

Thanks for a great idea, it works.
Thanks!

Alan B. Densky

Duane Hookom said:
You can change your properties to something like:
Name: txtField1
Control Source: =IIf([Field1]=0,Null,[Field1])
Can Shrink: Yes

Also set the section Can Shrink to Yes.
--
Duane Hookom
MS Access MVP
--

Alan B. Densky said:
I have an A 2000 database with a unique report. Each time the report is
run, it only displays data from one record in the table. It has dozens of
uniquely named fields, placed in a vertical column, in the detail area.
When the value in a field is zero, I would like to eliminate that field
from
the column on the report, and have all of the fields beneath it move up to
close up the vertical gap(s) left open by the fields that have been
eliminated from the report.

Of course it's easy to loop through all of the fields with a zero value,
and
make those fields invisible. But how can I make each zero value field,
and
all of the fields beneath it in the column, move up to close up the gap(s)
created by the invisible fields?

Anyone have any ideas on this one?

Alan B. Densky
 

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