How To Append Record To Recordset from another Filtered Recordset

J

James

I am trying to create a recordset based on a filtered recordset... Each
filter returns one record. I can't figure out how to append that record
to my recordset. Here's my code. Thanks.

Option Compare Database
Private OfferingData As DataSource
Dim fm As New FormManager
Private m_sourceData As String
Dim SearchParams(0)


Private Sub cmdShowReport_Click()

Dim dataHolder As ADODB.Recordset
Dim reportInstanceOfferings As New ADODB.Recordset
Dim grabOID As Long
Dim varItm As Variant
Dim varItmCount As Integer
Dim Count As Integer
Dim OfferingsToBuild() As Variant

Count = 0

'Bring in all offerings
m_sourceData = "Offerings_Display"
Set OfferingData = New DataSource
LoadData OfferingData
'Set the DataSource = ADODB.Recordset
Set dataHolder = OfferingData.Dataset

'Set varItm = Number of Child OfferingIDs
varItm = lbOfferingInstances.ListCount

'ReDim Variant = # Of Child OfferingIDs + Parent OfferingID
ReDim OfferingsToBuild(varItm + 1)

'Get Parent OfferingID
OfferingsToBuild(Count) =
Form_DisplayOfferings.OfferingsList.Form.Offering
Count = Count + 1

'Add Child OfferingIDs
Do Until Count = (varItm + 1)
OfferingsToBuild(Count) = lbOfferingInstances.ItemData(Count - 1)
Count = Count + 1
Loop

Count = 0

'Filter through all offerings... Pull record with specified OfferingID
Do Until Count = (varItm + 1)
dataHolder.Filter = "OfferingID = " & OfferingsToBuild(Count)
'I want to append the record from the filtered DataHolder
'to reportInstanceOfferings every time I run through the loop, How
Do I Do This??
Set reportInstanceOfferings = dataHolder
Count = Count + 1
Loop


Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top