B
B
Hello all, I have a question on running a recordset and how do I grab all
the data in the recordset in respect to 1 column and I want it to
concatenate together instead of overwriting the variable.. here is my code
which just adds the current one back to the itself instead of the previous
column value
Private Sub Report_Open(Cancel As Integer)
Dim dbs As Database, rst As Recordset
Dim strSQL As String, Lgh As String, PC As String, LT As String
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT * FROM LbrInv_PieceCount WHERE [Bundle_ID] = '" &
[Forms]![BundleEntryEdit]![BundleEntryEdit_subform].[Form]![Bundle_ID] & "'"
Set rst = dbs.OpenRecordset(strSQL)
Do While Not rst.EOF
Lgh = rst!Length_ID
LT = Lgh & " " & Lgh
PC = rst!Piece_Count
rst.MoveNext
Loop
Set dbs = Nothing
End Sub
also I have this running to on the report open should I instead be calling
this .. I eventually want the value returned to be on the report itself...
TIA
the data in the recordset in respect to 1 column and I want it to
concatenate together instead of overwriting the variable.. here is my code
which just adds the current one back to the itself instead of the previous
column value
Private Sub Report_Open(Cancel As Integer)
Dim dbs As Database, rst As Recordset
Dim strSQL As String, Lgh As String, PC As String, LT As String
' Return reference to current database.
Set dbs = CurrentDb
strSQL = "SELECT * FROM LbrInv_PieceCount WHERE [Bundle_ID] = '" &
[Forms]![BundleEntryEdit]![BundleEntryEdit_subform].[Form]![Bundle_ID] & "'"
Set rst = dbs.OpenRecordset(strSQL)
Do While Not rst.EOF
Lgh = rst!Length_ID
LT = Lgh & " " & Lgh
PC = rst!Piece_Count
rst.MoveNext
Loop
Set dbs = Nothing
End Sub
also I have this running to on the report open should I instead be calling
this .. I eventually want the value returned to be on the report itself...
TIA