J
JOM
My reports row source is from a crosstab query. The columns on my report are
undound as they are filled with the necessary infor. My problem is that I
want to have the each columns total, but i don't know how to..
Here is my open event procedure of the report.
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim i As Integer
Dim j As Integer
Dim intColCount As Integer
Dim strName As String
Dim s1 As String
Set db = CurrentDb
s1 = Me.RecordSource
Set qdf = db.QueryDefs(s1)
qdf.Parameters(0) = [Forms]![frmAcct]![txtBeginDate]
qdf.Parameters(1) = [Forms]![frmAcct]![txtEndDate]
Set rs = qdf.OpenRecordset
intColCount = rs.Fields.Count
j = 1
' Fill in information for the necessary controls.
For i = 1 To intColCount - 1
strName = rs.Fields(i).Name
Me.Controls("lblEmpl" & j).Caption = strName
Me.Controls("txtLoanNumbers" & j).ControlSource = strName
j = j + 1
Next i
'Move position of Row totals Label & Textbox if less than 13 loan numbers of
data is displayed
If intColCount < 15 Then
i = 0.65 * intColCount * 1440 'New left margin in twips (1 inch = 1440
twips)
End If
End Sub
undound as they are filled with the necessary infor. My problem is that I
want to have the each columns total, but i don't know how to..
Here is my open event procedure of the report.
Private Sub Report_Open(Cancel As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim i As Integer
Dim j As Integer
Dim intColCount As Integer
Dim strName As String
Dim s1 As String
Set db = CurrentDb
s1 = Me.RecordSource
Set qdf = db.QueryDefs(s1)
qdf.Parameters(0) = [Forms]![frmAcct]![txtBeginDate]
qdf.Parameters(1) = [Forms]![frmAcct]![txtEndDate]
Set rs = qdf.OpenRecordset
intColCount = rs.Fields.Count
j = 1
' Fill in information for the necessary controls.
For i = 1 To intColCount - 1
strName = rs.Fields(i).Name
Me.Controls("lblEmpl" & j).Caption = strName
Me.Controls("txtLoanNumbers" & j).ControlSource = strName
j = j + 1
Next i
'Move position of Row totals Label & Textbox if less than 13 loan numbers of
data is displayed
If intColCount < 15 Then
i = 0.65 * intColCount * 1440 'New left margin in twips (1 inch = 1440
twips)
End If
End Sub