Expression Help

eepok

Noob. Well, mostly noob.
Local time
Yesterday, 22:10
Joined
Oct 30, 2007
Messages
112
Code:
IIf(Len([wintercourse1])<4,"",IIf(Len([wintercourse1notes])<>0,[wintercourse1] & " - " & [wintercourse1notes]& (Chr(13)) & (Chr(10)),[wintercourse1]& (Chr(13)) & (Chr(10)))) & IIf(Len([wintercourse2])<4,"",IIf(Len([wintercourse2notes])<>0,[wintercourse2] & " - " & [wintercourse2notes]& (Chr(13)) & (Chr(10)),[wintercourse2]& (Chr(13)) & (Chr(10)))) & 
IIf(Len([wintercourse3])<4,"",IIf(Len([wintercourse3notes])<>0,[wintercourse3] & " - " & [wintercourse3notes]& (Chr(13)) & (Chr(10)),[wintercourse3]& (Chr(13)) & (Chr(10)))) & 
IIf(Len([wintercourse4])<4,"",IIf(Len([wintercourse4notes])<>0,[wintercourse4] & " - " & [wintercourse4notes],[wintercourse4]))

The above is an expression that combines a series of fields in a single cell based on certain criteria.

The "<4" exists because I have some 3-digit codes that are used for privacy sake in the database instead of what an instructor is doing that quarter. If the "course name" is longer than 4 characters, it displays. If the course has notes, it those notes are appended to the end of the course and a linebreak is inserted. If there are no notes, but still a course, just the course and a linebreak are put in the cell. This goes on for, potentially, 4 courses worth of data.

My problem is that when all is said and done, the resulting cell is never less than three lines tall. The cell could be empty or have 1/2/3/5/6/7 lines of data, but is never less than 3 lines tall.

This, obviously, takes up a bit of paper space. I know that if I remove the extra lines, I can knock a page off a 4-page report.

So, would any curious person look over that expression and let me know where I am going wrong?
 

Users who are viewing this thread

Back
Top Bottom