This seems to be a relatively simple problem. I have a table from which I get all the fields (sorted on selections by the user) though some of the fields may be null. I do not want to report the field or show the label of the null fields and I want to move up the fields below it (preferably to shorten the page and get more records on a page).
Now in my details section I have added an event procedure for the OnFormat event. In the event procedure I check the state of the field, setting the visible property and then setting the top property depending on the states of the various fields.
The problem is that format seems to stay the same for the next record, it does not start with the original format. For example say I have 4 fields, Mass and uncertainty 1 through 4. The fields are laid out on the report so that they are printed one below the other from 1 to 4.
When I open the report say the first record's Mass 1 and 4 are not null and in the second record all Mass fields have a value. I dynamically change (in the Onformat event) the format so Mass 1 prints with Mass 4 immediately below it, therefore the visible properties for Mass 2 and 3 are false cause I just set them that way. The next record the visible settings for the Mass 2 and 3 fields are still false and the Top value of field 4 is the value I set it to forthe previous record.
The format event is called for each record, Shouldn't the settings be reset since this is a new record? If not then I have to change the settings for every field for every record. This is a problem because I have multiple fields that I want to hide or display based on one fields value. There's got to be a better way. This gives "Hard coding" a new meaning.
Does anyone know of an easier way to do this?
Now in my details section I have added an event procedure for the OnFormat event. In the event procedure I check the state of the field, setting the visible property and then setting the top property depending on the states of the various fields.
The problem is that format seems to stay the same for the next record, it does not start with the original format. For example say I have 4 fields, Mass and uncertainty 1 through 4. The fields are laid out on the report so that they are printed one below the other from 1 to 4.
When I open the report say the first record's Mass 1 and 4 are not null and in the second record all Mass fields have a value. I dynamically change (in the Onformat event) the format so Mass 1 prints with Mass 4 immediately below it, therefore the visible properties for Mass 2 and 3 are false cause I just set them that way. The next record the visible settings for the Mass 2 and 3 fields are still false and the Top value of field 4 is the value I set it to forthe previous record.
The format event is called for each record, Shouldn't the settings be reset since this is a new record? If not then I have to change the settings for every field for every record. This is a problem because I have multiple fields that I want to hide or display based on one fields value. There's got to be a better way. This gives "Hard coding" a new meaning.
Does anyone know of an easier way to do this?