PDA

View Full Version : Solved: Conditional Detail Lines



jauner
12-20-2005, 10:41 AM
Is there a way based on a field in a query I can show x number of fields.

Here is an example. I have a total of 10 questions in a database. If a group field contains value A I want to show 8 questions, if it shows value b I want to show 6 questions and so forth.

Is there a way to do this on the same report? I know crystal reports can do this but I am unsure about access?

I was thinking this might be doable in the group header and footer areas and basically leave detail empty. Is this the right idea?

matthewspatrick
12-20-2005, 11:50 AM
How are these questions selected?

I suspect that the proper way to go is to set up the query underlying your report such that for 'A', only eight detail records apply, for 'B' only 6, etc.

Alternatively, it may be possible to use an OnFormat event sub for the Detail section to selection hide or show the detail lines, based on the value of a group field and one or more fields in the detail record.

jauner
12-27-2005, 08:35 AM
Yes that worked just fine.