Hi,
I'm really stuck on this one. I have a report with two text boxes that are sent to can grow and can shrink. Each text box is set to a control source ("ConcatenateMessage".
My query checks whether Message1 (date1) is different than Message1 (date2). If these two messages are different there are pulled back from my query. Then they are sent to my ConcatenateMessage function. Sometimes Message1 (date1) is five lines long on my report and Message1 (date2) is only one line on my report. Then Message2(date1) is five lines again and Message2(date2) is only one line again. The textboxes have there can shrink and can grow properties set to true. So, the Message2 text box with the shorter messages doesn't line up with the Message1 text box in these cases.
Can anything be done about this? It's driving me crazy.
This is the code that concatenates my messages:
Function ConcatenateMessages(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
Dim Mess1, Mess2, Mess3, Mess4, Mess5, Mess6, Mess7, Mess8, Mess9, Mess10, Mess11, Mess12
CR$ = Chr(13) & Chr(10) 'Carriage return and line feed.
If var1 & "" <> "" Then
Mess1 = "" & var1 & CR$
Else
Mess1 = ""
End If
If var2 & "" <> "" Then
Mess2 = "" & var2 & CR$
Else
Mess2 = ""
End If
If var3 & "" <> "" Then
Mess3 = "" & var3 & CR$
Else
Mess3 = ""
End If
If var4 & "" <> "" Then
Mess4 = "" & var4 & CR$
Else
Mess4 = ""
End If
If var5 & "" <> "" Then
Mess5 = "" & var5 & CR$
Else
Mess5 = ""
End If
If var6 & "" <> "" Then
Mess6 = "" & var6 & CR$
Else
Mess6 = ""
End If
If var7 & "" <> "" Then
Mess7 = "" & var7 & CR$
Else
Mess7 = ""
End If
If var8 & "" <> "" Then
Mess8 = "" & var8 & CR$
Else
Mess8 = ""
End If
If var9 & "" <> "" Then
Mess9 = "" & var9 & CR$
Else
Mess9 = ""
End If
If var10 & "" <> "" Then
Mess10 = "" & var10 & CR$
Else
Mess10 = ""
End If
If var11 & "" <> "" Then
Mess11 = "" & var11 & CR$
Else
Mess11 = ""
End If
If var12 & "" <> "" Then
Mess12 = "" & var12 & CR$
Else
Mess12 = ""
End If
ConcatenateMessages = Mess1 & Mess2 & Mess3 & Mess4 & Mess5 & Mess6 & Mess7 & Mess8 & Mess9 & Mess10 & Mess11 & Mess12 'concatenate the strings.
Thanks,
MBaddar
I'm really stuck on this one. I have a report with two text boxes that are sent to can grow and can shrink. Each text box is set to a control source ("ConcatenateMessage".
My query checks whether Message1 (date1) is different than Message1 (date2). If these two messages are different there are pulled back from my query. Then they are sent to my ConcatenateMessage function. Sometimes Message1 (date1) is five lines long on my report and Message1 (date2) is only one line on my report. Then Message2(date1) is five lines again and Message2(date2) is only one line again. The textboxes have there can shrink and can grow properties set to true. So, the Message2 text box with the shorter messages doesn't line up with the Message1 text box in these cases.
Can anything be done about this? It's driving me crazy.
This is the code that concatenates my messages:
Function ConcatenateMessages(var1, var2, var3, var4, var5, var6, var7, var8, var9, var10, var11, var12)
Dim Mess1, Mess2, Mess3, Mess4, Mess5, Mess6, Mess7, Mess8, Mess9, Mess10, Mess11, Mess12
CR$ = Chr(13) & Chr(10) 'Carriage return and line feed.
If var1 & "" <> "" Then
Mess1 = "" & var1 & CR$
Else
Mess1 = ""
End If
If var2 & "" <> "" Then
Mess2 = "" & var2 & CR$
Else
Mess2 = ""
End If
If var3 & "" <> "" Then
Mess3 = "" & var3 & CR$
Else
Mess3 = ""
End If
If var4 & "" <> "" Then
Mess4 = "" & var4 & CR$
Else
Mess4 = ""
End If
If var5 & "" <> "" Then
Mess5 = "" & var5 & CR$
Else
Mess5 = ""
End If
If var6 & "" <> "" Then
Mess6 = "" & var6 & CR$
Else
Mess6 = ""
End If
If var7 & "" <> "" Then
Mess7 = "" & var7 & CR$
Else
Mess7 = ""
End If
If var8 & "" <> "" Then
Mess8 = "" & var8 & CR$
Else
Mess8 = ""
End If
If var9 & "" <> "" Then
Mess9 = "" & var9 & CR$
Else
Mess9 = ""
End If
If var10 & "" <> "" Then
Mess10 = "" & var10 & CR$
Else
Mess10 = ""
End If
If var11 & "" <> "" Then
Mess11 = "" & var11 & CR$
Else
Mess11 = ""
End If
If var12 & "" <> "" Then
Mess12 = "" & var12 & CR$
Else
Mess12 = ""
End If
ConcatenateMessages = Mess1 & Mess2 & Mess3 & Mess4 & Mess5 & Mess6 & Mess7 & Mess8 & Mess9 & Mess10 & Mess11 & Mess12 'concatenate the strings.
Thanks,
MBaddar