By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,575 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,575 IT Pros & Developers. It's quick & easy.

Access reporting problem

P: n/a
Recordsets in my database use 120 fields, but the average recordset uses
only about 20 fields, what leaves 100 fields NULL in each line.
When I use the regular access reporting, I always get shown every field from
my table, but I need a report that shows only fields that are not empty.

Can I get field after field printed, like that:
FIELD1 VALUE1; .. skip empty fields ... FIELD4 VALUE4; .. skip empty fields
... FIELD29 VALUE29 and so on?

Thanks

Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"M. Schroeder" <sc*******@yahoo.de> wrote in
news:cv**********@online.de:
Recordsets in my database use 120 fields, but the average
recordset uses only about 20 fields, what leaves 100 fields
NULL in each line. When I use the regular access reporting, I
always get shown every field from my table, but I need a
report that shows only fields that are not empty.

Can I get field after field printed, like that:
FIELD1 VALUE1; .. skip empty fields ... FIELD4 VALUE4; .. skip
empty fields .. FIELD29 VALUE29 and so on?

Thanks

You can use the wizard to create a report with only twenty
fields.

You can also add code to the report's on format events to make a
field not visible if the contents are null.

e.g. me.field2.visible = not isnull( me.field2.value )

You need to set the can shrink property of the field and of the
section to yes.
--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #2

P: n/a
"Bob Quintal" <rq******@sPAmpatico.ca> schrieb im Newsbeitrag
news:1108910089.cbaad58bbf920cc7c18670311b11d67f@t eranews...
"M. Schroeder" <sc*******@yahoo.de> wrote in
news:cv**********@online.de:
Recordsets in my database use 120 fields, but the average
recordset uses only about 20 fields, what leaves 100 fields
NULL in each line. When I use the regular access reporting, I
always get shown every field from my table, but I need a
report that shows only fields that are not empty.

Can I get field after field printed, like that:
FIELD1 VALUE1; .. skip empty fields ... FIELD4 VALUE4; .. skip
empty fields .. FIELD29 VALUE29 and so on?

Thanks

You can use the wizard to create a report with only twenty
fields.

You can also add code to the report's on format events to make a
field not visible if the contents are null.

e.g. me.field2.visible = not isnull( me.field2.value )

You need to set the can shrink property of the field and of the
section to yes.


Does this mean the skipped fields do not use space on the report?
I found the property can grow/shrink not very reliable.
I think this will not work properly with 70 fields.

I would prefer the report in a textfile. I think the best solution for me
was to go through a VB-recordset and test each field if NULL or not NULL,
and write them into a file?

Nov 13 '05 #3

P: n/a
dim db as database
dim tdf as tabledef (or qdf as querydef if your data is all brought
together/filtered in a query)
dim fld as field
Const cSEP As String = " "
set db=currentdb
set tdf = db.tabledefs("SomeTable") '--use db.QueryDefs() if you're
getting your data from a querydef

for each fld in tdf.fields
write #fileNo, fld.Name& cSEP & fld.value
next fld
set fld=nothing
set tdf=nothing
set db=nothing

Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.