H
heidii
Hi there:
I have created a report that runs from a datasheet form. I can hide
and unhide the columns in my form and then generate report where it
then hides or unhides my columns the same as my form. But I don't
know how to make my columns that I have made invisible move to the
left instead of leaving a gap on my report.
I need help.
Here is the code that I am using now for making the columns invisible:
My code for all the labels is the same except different names.
Thanks in advance
Heidi
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms![frm-ranch_info_ranch_view]![LOT#].ColumnHidden Then
Me.[LOT#].Visible = False
Else
Me.[LOT#].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![RANCH].ColumnHidden Then
Me.RANCH.Visible = False
Else
Me.RANCH.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![BLOCKTYPE].ColumnHidden Then
Me.BLOCKTYPE.Visible = False
Else
Me.BLOCKTYPE.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![VARIETY].ColumnHidden Then
Me.VARIETY.Visible = False
Else
Me.VARIETY.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Acres].ColumnHidden Then
Me.Acres.Visible = False
Else
Me.Acres.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Spacing].ColumnHidden Then
Me.Spacing.Visible = False
Else
Me.Spacing.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![ROOTSTOCK].ColumnHidden Then
Me.ROOTSTOCK.Visible = False
Else
Me.ROOTSTOCK.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Trellis].ColumnHidden Then
Me.Trellis.Visible = False
Else
Me.Trellis.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Planted].ColumnHidden Then
Me.Planted.Visible = False
Else
Me.Planted.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Grafted].ColumnHidden Then
Me.Grafted.Visible = False
Else
Me.Grafted.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![STATUS].ColumnHidden Then
Me.STATUS.Visible = False
Else
Me.STATUS.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![WSDA SITE NUMBER].ColumnHidden
Then
Me.[WSDA SITE NUMBER].Visible = False
Else
Me.[WSDA SITE NUMBER].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![COMMODITY].ColumnHidden Then
Me.COMMODITY.Visible = False
Else
Me.COMMODITY.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![WSDACert#].ColumnHidden Then
Me.[WSDACert#].Visible = False
Else
Me.[WSDACert#].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![MASTER VARIETY].ColumnHidden
Then
Me.[MASTER VARIETY].Visible = False
Else
Me.[MASTER VARIETY].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Block].ColumnHidden Then
Me.Block.Visible = False
Else
Me.Block.Visible = True
End If
End Sub
I have created a report that runs from a datasheet form. I can hide
and unhide the columns in my form and then generate report where it
then hides or unhides my columns the same as my form. But I don't
know how to make my columns that I have made invisible move to the
left instead of leaving a gap on my report.
I need help.
Here is the code that I am using now for making the columns invisible:
My code for all the labels is the same except different names.
Thanks in advance
Heidi
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms![frm-ranch_info_ranch_view]![LOT#].ColumnHidden Then
Me.[LOT#].Visible = False
Else
Me.[LOT#].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![RANCH].ColumnHidden Then
Me.RANCH.Visible = False
Else
Me.RANCH.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![BLOCKTYPE].ColumnHidden Then
Me.BLOCKTYPE.Visible = False
Else
Me.BLOCKTYPE.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![VARIETY].ColumnHidden Then
Me.VARIETY.Visible = False
Else
Me.VARIETY.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Acres].ColumnHidden Then
Me.Acres.Visible = False
Else
Me.Acres.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Spacing].ColumnHidden Then
Me.Spacing.Visible = False
Else
Me.Spacing.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![ROOTSTOCK].ColumnHidden Then
Me.ROOTSTOCK.Visible = False
Else
Me.ROOTSTOCK.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Trellis].ColumnHidden Then
Me.Trellis.Visible = False
Else
Me.Trellis.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Planted].ColumnHidden Then
Me.Planted.Visible = False
Else
Me.Planted.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Grafted].ColumnHidden Then
Me.Grafted.Visible = False
Else
Me.Grafted.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![STATUS].ColumnHidden Then
Me.STATUS.Visible = False
Else
Me.STATUS.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![WSDA SITE NUMBER].ColumnHidden
Then
Me.[WSDA SITE NUMBER].Visible = False
Else
Me.[WSDA SITE NUMBER].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![COMMODITY].ColumnHidden Then
Me.COMMODITY.Visible = False
Else
Me.COMMODITY.Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![WSDACert#].ColumnHidden Then
Me.[WSDACert#].Visible = False
Else
Me.[WSDACert#].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![MASTER VARIETY].ColumnHidden
Then
Me.[MASTER VARIETY].Visible = False
Else
Me.[MASTER VARIETY].Visible = True
End If
If Forms![frm-ranch_info_ranch_view]![Block].ColumnHidden Then
Me.Block.Visible = False
Else
Me.Block.Visible = True
End If
End Sub