When I print the data report the output does not display as I intended it to.
I want the Name to be displayed to be unique with the weights shown in MS Access for that indivdual to be SUMmed up.
Any Ideas?
[CODE=vb]Private Function CreateRecords() As ADODB.Recordset
Dim conLog As ADODB.Connectio n
Dim rsLog As ADODB.Recordset
'Open a connection to the Database
Set conLog = New ADODB.Connectio n
conLog.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\DutyL og.mdb; Persist Security Info=False"
conLog.Open
'Find Log Entries
Set rsLog = conLog.Execute( "SELECT DISTINCTROW tblWeight.Couri er, tblWeight.Weigh t As [Sum Of Weight] " & _
"FROM tblWeight " & _
"WHERE tblWeight.Event Date Between #" & calWeight1 & "# AND #" & calWeight2 & "#")
'Creates a disconnected recordset
Dim rsTemp As New ADODB.Recordset
With rsTemp
' Create Recordset Fields
.Fields.Append "Name", adVarChar, 40
.Fields.Append "Weight", adInteger
.CursorType = adOpenKeyset
.LockType = adLockOptimisti c
.Open
' Add a new item record
Do While Not rsLog.EOF
.AddNew
![Name] = rsLog(0)
![Weight] = rsLog(1)
.Update
rsLog.MoveNext
Loop
End With
Set CreateRecords = rsTemp
'Close the connection to the Database
conLog.Close
End Function[/CODE]
I want the Name to be displayed to be unique with the weights shown in MS Access for that indivdual to be SUMmed up.
Any Ideas?
[CODE=vb]Private Function CreateRecords() As ADODB.Recordset
Dim conLog As ADODB.Connectio n
Dim rsLog As ADODB.Recordset
'Open a connection to the Database
Set conLog = New ADODB.Connectio n
conLog.Connecti onString = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\DutyL og.mdb; Persist Security Info=False"
conLog.Open
'Find Log Entries
Set rsLog = conLog.Execute( "SELECT DISTINCTROW tblWeight.Couri er, tblWeight.Weigh t As [Sum Of Weight] " & _
"FROM tblWeight " & _
"WHERE tblWeight.Event Date Between #" & calWeight1 & "# AND #" & calWeight2 & "#")
'Creates a disconnected recordset
Dim rsTemp As New ADODB.Recordset
With rsTemp
' Create Recordset Fields
.Fields.Append "Name", adVarChar, 40
.Fields.Append "Weight", adInteger
.CursorType = adOpenKeyset
.LockType = adLockOptimisti c
.Open
' Add a new item record
Do While Not rsLog.EOF
.AddNew
![Name] = rsLog(0)
![Weight] = rsLog(1)
.Update
rsLog.MoveNext
Loop
End With
Set CreateRecords = rsTemp
'Close the connection to the Database
conLog.Close
End Function[/CODE]
Comment