Report design Show and Shrink

T.Smith

IT1(SW)
Local time
Today, 12:46
Joined
Dec 22, 2007
Messages
28
I'm seeking help on a report design.

On the group footer, there are a total of 20 horizontal textboxes. Textbox 1 at top and continues down to 20. This section of the report will display user comments entered from a previous form also displayed in the same format. What I would like it to do is display each textbox whether null or not null until the last "user typed in" textbox and then shrink the rest. This will allow users to space comments if need be and to eliminate that blank page when each textbox is set not to shrink.


Report Layout:

Fixed Page Header
ID Header
Detail
Group Footer
1. [User adds comments here]
This blank line visible
3. [User adds comments here]
and shrink textbox's 4 through 20
Fixed Page Footer


I found this function and tried working with it but couldn't get the array to work like I described above. If you can help, that would be great.

Public Function CanShrinkLines(ParamArray arrLines())
' Pass this function the lines to be combined
' For example: strAddress =
' CanShrinkLines(Name, Address1, Address2, City, St, Zip)
Dim x As Integer, strLine As String

For x = 0 To UBound(arrLines)

If Not IsNull(arrLines(x)) And arrLines(x) <> "" Then
strLine = strLine & arrLines(x) & vbCrLf
End If
Next
CanShrinkLines = strLine
End Function
 
Need help...Almost there

Hi All,

So far I've decided to use one textbox and use IIf statements on my report. Is there any way to use multiple fields or variables with IIf? For example:

A1$ = IIf(ISB("NoteLine2 through NoteLine20"), "", NoteLine1 & CR$)

What I'm trying to do is keep lines until last user selected note line and drop the rest.

My code is:

Code:
Function NoteBlock$(NoteLine1, NoteLine2, NoteLine3, NoteLine4, NoteLine5, NoteLine6, NoteLine7, _
NoteLine8, NoteLine9, NoteLine10, NoteLine11, NoteLine12, NoteLine13, NoteLine14, NoteLine15, _
NoteLine16, NoteLine17, NoteLine18, NoteLine19, NoteLine20)

   Dim A1$, A2$, A3$, A4$, A5$, A6$, A7$, A8$, A9$, A10$, A11$, A12$, _
       A13$, A14$, A15$, A16$, A17$, A18$, A19$, A20$, CR$

   CR$ = Chr(13) & Chr(10)  'Carriage return and line feed.
   
   A1$ = IIf(ISB(NoteLine1), "", NoteLine1 & CR$)
   A2$ = IIf(ISB(NoteLine2), "", NoteLine2 & CR$)
   A3$ = IIf(ISB(NoteLine3), "", NoteLine3 & CR$)
   A4$ = IIf(ISB(NoteLine4), "", NoteLine4 & CR$)
   A5$ = IIf(ISB(NoteLine5), "", NoteLine5 & CR$)
   A6$ = IIf(ISB(NoteLine6), "", NoteLine6 & CR$)
   A7$ = IIf(ISB(NoteLine7), "", NoteLine7 & CR$)
   A8$ = IIf(ISB(NoteLine8), "", NoteLine8 & CR$)
   A9$ = IIf(ISB(NoteLine9), "", NoteLine9 & CR$)
   A10$ = IIf(ISB(NoteLine10), "", NoteLine10 & CR$)
   A11$ = IIf(ISB(NoteLine11), "", NoteLine11 & CR$)
   A12$ = IIf(ISB(NoteLine12), "", NoteLine12 & CR$)
   A13$ = IIf(ISB(NoteLine13), "", NoteLine13 & CR$)
   A14$ = IIf(ISB(NoteLine14), "", NoteLine14 & CR$)
   A15$ = IIf(ISB(NoteLine15), "", NoteLine15 & CR$)
   A16$ = IIf(ISB(NoteLine16), "", NoteLine16 & CR$)
   A17$ = IIf(ISB(NoteLine17), "", NoteLine17 & CR$)
   A18$ = IIf(ISB(NoteLine18), "", NoteLine18 & CR$)
   A19$ = IIf(ISB(NoteLine19), "", NoteLine19 & CR$)
   A20$ = IIf(ISB(NoteLine20), "", NoteLine20 & CR$)


    'Concatenate the strings.
   NoteBlock = A1$ & A2$ & A3$ & A4$ & A5$ & A6$ & A7$ & A8$ & A9$ & A10$ & _
      A11$ & A12$ & A13$ & A14$ & A15$ & A16$ & A17$ & A18$ & A19$ & A20$
End Function

Thanks in advance,
Toby
 

Users who are viewing this thread

Back
Top Bottom