P
poucedeleon via AccessMonster.com
I am trying to use some code from Allen Browne that adds column headers to
your snaking column in a report. I am not sure where to put the line below
surrounded by astrist. I tried to put it in the general area of the form code
but that would not work. Can someone give me some advise.
To get a snaking column header above each column but only if the column has
data in it do the following:
Say you have two fields in the snaking column in the detail section of your
report. ITEM and CARRYING.
Create two unbound fields in the detail section and name them ITEM HEADER and
CARRYING HEADER. Align them above the matching field getting just the way you
want them (at the top of the detail section).Set their properties to be:
Can grow: Yes
Visible: Yes
Height:
0.0007 in.Now move the actual fields up just underneath the now very skinny
headers.
In the properties for the detail section add an event procedure to the On
Format. In it put the following code:
Sub Detail1_Format (Cancel As Integer, FormatCount As Integer)
If Me.left <> dLastLeft Then
Me![ITEM HEADER] = "Item"
Me![CARRYING HEADER] = "Carrying"
dLastLeft = Me.left
sItem = Me![ITEM]
Else
If sItem = Me![ITEM] Then
Me![ITEM HEADER] = "Item"
Me![CARRYING HEADER] = "Carrying"
Else
Me![ITEM HEADER] = ""
Me![CARRYING HEADER] = ""
End If
End If
End Sub
Set up the fields dLastLeft and sItem in any module in the general section:
*Global dLastLeft As DoubleGlobal, sItem As String*
Compile and save the module.
your snaking column in a report. I am not sure where to put the line below
surrounded by astrist. I tried to put it in the general area of the form code
but that would not work. Can someone give me some advise.
To get a snaking column header above each column but only if the column has
data in it do the following:
Say you have two fields in the snaking column in the detail section of your
report. ITEM and CARRYING.
Create two unbound fields in the detail section and name them ITEM HEADER and
CARRYING HEADER. Align them above the matching field getting just the way you
want them (at the top of the detail section).Set their properties to be:
Can grow: Yes
Visible: Yes
Height:
0.0007 in.Now move the actual fields up just underneath the now very skinny
headers.
In the properties for the detail section add an event procedure to the On
Format. In it put the following code:
Sub Detail1_Format (Cancel As Integer, FormatCount As Integer)
If Me.left <> dLastLeft Then
Me![ITEM HEADER] = "Item"
Me![CARRYING HEADER] = "Carrying"
dLastLeft = Me.left
sItem = Me![ITEM]
Else
If sItem = Me![ITEM] Then
Me![ITEM HEADER] = "Item"
Me![CARRYING HEADER] = "Carrying"
Else
Me![ITEM HEADER] = ""
Me![CARRYING HEADER] = ""
End If
End If
End Sub
Set up the fields dLastLeft and sItem in any module in the general section:
*Global dLastLeft As DoubleGlobal, sItem As String*
Compile and save the module.