D
DBarker
I had originally posted this question in the Queries
section because I was looking at working with an append
query but it has seem to have gotten much more
complicated. This is the situation. I have one table
that contains duplicate case IDs and different Notes
fields associated with that case ID. Then I have my main
table where I want to insert the comments concatenate
them from the first table based on the case ID. I am
having an issue with the syntax. Below is what I have so
far but it is not working.
Public Sub Combine()
Dim dbs As Database
Dim FromTbl As TableDef
Dim ToTbl As TableDef
Dim FromFld As Variant
Dim ToFld As Variant
Dim Multiple_Journals_Table1 As TableDef
Dim STi_Table As TableDef
Set dbs = CurrentDb
Set FromTbl = Multiple_Journals_Table1
Set ToTbl = STi_Table
Set FromFld = Multiple_Journals_Table1.Fields
Set ToFld = STi_Table.Fields
If FromTbl.caseID = ToTbl.case# Then
ToFld = ToFld & JFrom
Else
.MoveNext
If EOF Then
End
End If
End If
End Sub
section because I was looking at working with an append
query but it has seem to have gotten much more
complicated. This is the situation. I have one table
that contains duplicate case IDs and different Notes
fields associated with that case ID. Then I have my main
table where I want to insert the comments concatenate
them from the first table based on the case ID. I am
having an issue with the syntax. Below is what I have so
far but it is not working.
Public Sub Combine()
Dim dbs As Database
Dim FromTbl As TableDef
Dim ToTbl As TableDef
Dim FromFld As Variant
Dim ToFld As Variant
Dim Multiple_Journals_Table1 As TableDef
Dim STi_Table As TableDef
Set dbs = CurrentDb
Set FromTbl = Multiple_Journals_Table1
Set ToTbl = STi_Table
Set FromFld = Multiple_Journals_Table1.Fields
Set ToFld = STi_Table.Fields
If FromTbl.caseID = ToTbl.case# Then
ToFld = ToFld & JFrom
Else
.MoveNext
If EOF Then
End
End If
End If
End Sub