Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide blank lines on a form

Status
Not open for further replies.

ccarpent

MIS
Apr 8, 2003
3
US
I probably should have created this as a REPORT but currently I am using a form to resemble a REPORT. I have written VB Code to not print the lines that have a value = 0. The form has a possible of 48 lines of values, 7 rows across and then a total column. If the total column = 0, i do not want to display that line, however, I want the next line that DOES have a value to display without leaving gaps.

This is my first time so let me know if you need more info.
 
How is your form organised? Is each line in a label or text box or is it globally in a flexgrid or some other control?
How does the information get there?

If you put the information individually, line by line, couldn't you not write the information when the toal is null?

Please give some more info about the whole structure,

Nathalie
 
The form layout:

Req Type Beg Recd Not Dev UAT Can Prod Total
Mo # # Assgn
Label val1 val2 val3 val4 val5 val6 val7 val8
Label val1 val2 val3 val4 val5 val6 val7 val8

TOTALS val1 val2 val3 val4 val5 val6 val7 val8
etc.

Each value is coded to count the number of records for each column

Sample Code to count records:

Me![A1] = DCount("[REQUEST_NUMBER]", _
"ADPR_IMPORT_TABLE", _
"(Left([REQUEST_NUMBER], 3) = 'ES ') AND " & _
&quot;[MIS_SUPERVISOR] <> 'ES#6909' AND &quot; & _
&quot;[Request_Date] < #&quot; & VMonthBeginDate & &quot;# AND &quot; & _
&quot;[REQUEST_TYPE] = 11 AND [COMPLEXITY_RANK] = 1 AND &quot; & _
&quot;(([Approved_Date] is null AND [Cancelled_Date] is null) OR &quot; & _
&quot;([Approved_Date] >= #&quot; & VMonthBeginDate & &quot;# OR [Cancelled_Date] >= #&quot; & VMonthBeginDate & &quot;#))&quot;)

Sample Code to suppress lines that have a 0 value for VAL8:
Private Sub PRT_TOTALS_41()
If [H41] = 0 Then
[L41].Visible = False
[A41].Visible = False
[B41].Visible = False
[C41].Visible = False
[D41].Visible = False
[E41].Visible = False
[F41].Visible = False
[G41].Visible = False
[H41].Visible = False
End If
End Sub

The code to count the records works.
The code to suppress the rows that VAL 8 is 0 works.
I just need to suppress the gaps between the Request Types where val8 is 0

Does this help??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top