E
Eric
I have a table that contains multiple fields that are in pairs. One field
containing a piece of data to be printed on a report and another field that
contains a single character to controld the field formatting.
Example-
top msg 1 = "Joe Brown" / top msg 1 atr = "B" ' this means that I need
the field on the report to print bold
top msg 2 = "Mary Jane" / top msg 2 atr = "U" ' this means that I need
the field on the report to print underline
top msg 3 = "Joe Brown" / top msg 3 atr = "N" ' this means that I need
the field on the report to print normal
top msg 4 = "Mary Jane" / top msg 4 atr = "I" ' this means that I need
the field on the report to print italic
What I would like to do is set up a loop (I will have a known number of
fields to loop through) and upon formatting each page of the report I want
to run the code that changes the formatting of the report field. The fields
are all named the same except for a numeric value in the field name. I would
rather reference a field on the recordset than on the report itself. Here is
what I have done so far:
Select Case Me.[top msg 1 atr].Value
Case N
Me.top_msg_1.FontBold = False
Me.top_msg_1.FontItalic = False
Me.top_msg_1.FontUnderline = False
Case B
Me.top_msg_1.FontBold = True
Case I
Me.top_msg_1.FontItalic = True
Case U
Me.top_msg_1.FontUnderline = True
End Select
This code works for each field of the report, but requires me to place the
attribute field on the report as well. I just made the attribute field
hidden so that it does not print on the report. With this type of coding, I
will have to copy the select case for every field that I am formatting. I
only have about 60 fields on the report to do this way, but I know there
MUST be a way to do it in a loop.
If anyone can help, I would much appreciate it!!!
containing a piece of data to be printed on a report and another field that
contains a single character to controld the field formatting.
Example-
top msg 1 = "Joe Brown" / top msg 1 atr = "B" ' this means that I need
the field on the report to print bold
top msg 2 = "Mary Jane" / top msg 2 atr = "U" ' this means that I need
the field on the report to print underline
top msg 3 = "Joe Brown" / top msg 3 atr = "N" ' this means that I need
the field on the report to print normal
top msg 4 = "Mary Jane" / top msg 4 atr = "I" ' this means that I need
the field on the report to print italic
What I would like to do is set up a loop (I will have a known number of
fields to loop through) and upon formatting each page of the report I want
to run the code that changes the formatting of the report field. The fields
are all named the same except for a numeric value in the field name. I would
rather reference a field on the recordset than on the report itself. Here is
what I have done so far:
Select Case Me.[top msg 1 atr].Value
Case N
Me.top_msg_1.FontBold = False
Me.top_msg_1.FontItalic = False
Me.top_msg_1.FontUnderline = False
Case B
Me.top_msg_1.FontBold = True
Case I
Me.top_msg_1.FontItalic = True
Case U
Me.top_msg_1.FontUnderline = True
End Select
This code works for each field of the report, but requires me to place the
attribute field on the report as well. I just made the attribute field
hidden so that it does not print on the report. With this type of coding, I
will have to copy the select case for every field that I am formatting. I
only have about 60 fields on the report to do this way, but I know there
MUST be a way to do it in a loop.
If anyone can help, I would much appreciate it!!!