This works perfectly if I just have 1 primary key that is a number field.
Now I have 2 fields that are the primary key. One is a number, and one is a text field.
I need to be able to compare each record by the 2 fields...
How can I get this to do that...?
Do Until rstBase.EOF
If rstVarying.EOF = True Then
ElseIf rstBase(PrimaryKeyField) > rstVarying(PrimaryKeyField) Then
ElseIf rstBase(PrimaryKeyField) < rstVarying(PrimaryKeyField) Then
For Each fld In rstBase.Fields
If Nz(rstBase(fld.Name)) <> Nz(rstVarying(fld.Name)) Then
db.Execute "INSERT INTO Event_Changes_1 (Event_ID, FieldName, OldText, NewText, Modified_Date, Carrier) " & _
"SELECT " & rstBase(PrimaryKeyField) & ", '" & fld.Properties("Caption") & "','" & Nz(rstBase(fld.Name), "<Null>") & "','" & Nz(rstVarying(fld.Name), "<Null>") & "', '" & rstVarying!Modified_Date & "', '" & rstVarying!Display_Name & "';"
FieldChanged = True
FieldChanged = False