heres the code to query 4 tables (necessary to query all 4 tables)
Code:
SELECT * into tblDUPLICATE FROM ((CRIME LEFT JOIN SUSPECTS ON CRIME.CITE_NR = SUSPECTS.CITE_NR) LEFT JOIN OFFENSE ON CRIME.CITE_NR =
OFFENSE.CITE_NR) LEFT JOIN VICTIMS ON CRIME.CITE_NR = VICTIMS.CITE_NR WHERE (Year([DATE_COMTD])= YEAR(DATE());
heres my code to
MERGE record with the same CITE_NR AND NOT same V_NO
WILL NOT MERGE if same CITE_NR AND SAME V_NO
Code:
Do Until BasRecSet.EOF
Do Until rsMerge.EOF
SQLScript01 = "SELECT * FROM " & STR4Query & " WHERE CITE_NR like " & Trim(rsMerge!CITE_NR)
Set strBravo = CurrentDb.OpenRecordset(SQLScript01)
With strBravo
If BasRecSet.Updatable Then
If rsMerge!V_NO <> BasRecSet!V_NO Then
BasRecSet.Edit
BasRecSet!V_NAME = BasRecSet!V_NAME & ", " & BasRecSet!V_NAME
BasRecSet!V_SEX = BasRecSet!V_SEX & ", " & BasRecSet!V_SEX
BasRecSet!V_AGE = BasRecSet!V_AGE & ", " & BasRecSet!V_AGE
BasRecSet.Update
ElseIf rsMerge!S_NO <> BasRecSet!S_NO Then
BasRecSet.Edit
BasRecSet!S_NAME = BasRecSet!S_NAME & ", " & BasRecSet!S_NAME
BasRecSet!S_SEX = BasRecSet!S_SEX & ", " & BasRecSet!S_SEX
BasRecSet!S_AGE = BasRecSet!S_AGE & ", " & BasRecSet!S_AGE
BasRecSet.Update
End If
Else
MsgBox "Table Cannot Use for Updating!"
End If
End With
rsMerge.MoveNext
Loop
BasRecSet.MoveNext
Loop
but not performing the way i needed the code to
as shown from the screenshots...