D
DBarker
I originally posted this and had no takers so now I am
reposting. Any help would be appreciated.
Below is the code that Elwin helped me with and it works
GREAT. Now I have an additional need. I have a date
field that I want to put before each Note instead of
the ; that now goes before. I know somewhat of what this
code is doing, but I am not sure where I would place
this. Any help would be appreciated.
Debbie
----------------------------------------------------------
Public Sub Combine()
Dim strSQL As String
Dim dbs As DAO.Database
Dim rstFr As DAO.Recordset
Dim rstTo As DAO.Recordset
Dim varNoteBatch As Variant
Set dbs = CurrentDb()
strSQL = "SELECT STi_Table.* " _
& "FROM STi_Table " _
& "ORDER BY CaseID"
Set rstTo = dbs.OpenRecordset(strSQL, dbOpenDynaset)
strSQL = "SELECT STi_Multiples.* " _
& "FROM STi_Multiples " _
& "ORDER BY CaseID"
Set rstFr = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Do Until rstTo.EOF
varNoteBatch = Null
strSQL = "[CaseID]=" & rstTo!CaseID
rstFr.FindFirst strSQL
Do Until rstFr.NoMatch
varNoteBatch = varNoteBatch & "; " _
& rstFr!Journals
rstFr.FindNext strSQL
Loop
rstTo.Edit
rstTo!Journals = varNoteBatch
rstTo.Update
rstTo.MoveNext
Loop
rstFr.Close
rstTo.Close
Set rstFr = Nothing
Set rstTo = Nothing
End Sub
..
reposting. Any help would be appreciated.
Below is the code that Elwin helped me with and it works
GREAT. Now I have an additional need. I have a date
field that I want to put before each Note instead of
the ; that now goes before. I know somewhat of what this
code is doing, but I am not sure where I would place
this. Any help would be appreciated.
Debbie
----------------------------------------------------------
Public Sub Combine()
Dim strSQL As String
Dim dbs As DAO.Database
Dim rstFr As DAO.Recordset
Dim rstTo As DAO.Recordset
Dim varNoteBatch As Variant
Set dbs = CurrentDb()
strSQL = "SELECT STi_Table.* " _
& "FROM STi_Table " _
& "ORDER BY CaseID"
Set rstTo = dbs.OpenRecordset(strSQL, dbOpenDynaset)
strSQL = "SELECT STi_Multiples.* " _
& "FROM STi_Multiples " _
& "ORDER BY CaseID"
Set rstFr = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Do Until rstTo.EOF
varNoteBatch = Null
strSQL = "[CaseID]=" & rstTo!CaseID
rstFr.FindFirst strSQL
Do Until rstFr.NoMatch
varNoteBatch = varNoteBatch & "; " _
& rstFr!Journals
rstFr.FindNext strSQL
Loop
rstTo.Edit
rstTo!Journals = varNoteBatch
rstTo.Update
rstTo.MoveNext
Loop
rstFr.Close
rstTo.Close
Set rstFr = Nothing
Set rstTo = Nothing
End Sub
..