View Full Version : Formatting "paragraphs" in memo type report.


jrsteensen
11-05-2010, 07:18 AM
Hey all, Just working on a project at work, and this report formats data into a memo format. I am having a hard time formatting this. I basically have 4 text boxes running margin to margin (containing data for 5 different fields.) with an additional text box for the paragraph number for each line (10 text boxes total). I am trying to get it to format the paragraph number text box in case one of the fields is missing, and I also do not want it to display the space for the text box or the paragraph header.
I have worked out my psudeocode but am having issues with the syntax in the data source expressions from here

Access Version: ACCESS 2007
Psudeocode follows:

Note: "" = ZLS
If Paragraph1 = NULL or "" Then Prefix Paragraph1 field with "" AND Paragraph1Num = ""
Else
Prefix Paragraph1 field with "Paragraph1Header." AND paragraph1Num = "1."
If Paragraph1 = NULL or "" Then Prefix Paragraph2 field with "Paragraph2Header." AND Paragraph2Num = "1."
Else
Prefix Paragraph2 field with "Paragraph2Header." AND paragraph2Num = "2."
If Paragraph2 = NULL or "" Then Prefix Paragraph3 field "Paragraph3Header." AND paragraph3Num = "2."
Else
Prefix Paragraph3 field with "Paragraph3Header." AND paragraph3Num = "3."
If Paragraph3 = NULL or "" Then Prefix Paragraph4 field "Paragraph4Header." AND paragraph4Num = "3."
Else
Prefix Paragraph4 field with "Paragraph4Header." AND paragraph4Num = "4."
If Pragraph4 = NULL or "" Then Prefix Paragraph5 field "Paragraph5Header." AND paragraph5Num = "4."
Else
Prefix Paragraph5 field with "Paragraph5Header." AND paragraph5Num = "5."

jrsteensen
11-05-2010, 08:59 AM
Partially figured it out....however I just realized the following code breaks down if more than one of the directly preceding paragraphs are null or ZLS.

=IIf(nz([Text156],"")="","",IIf([Text155]="","2.","3."))

I am having a hard time wrapping my head around the logic to do this.