OK, I got my other queries to work (thanks from help here!)
I now have to do another update query but this time the Primary key is two fields in both TableA and TableB
How do you code that?
This is what I have
Dim SQL1 As String
SQL1 = "Update A_Addr" & " RIGHT JOIN csm_addr " & _
"ON Ar_Addr.Key = csm_addr.addr_prop " & _
"SET Ar_Addr.Key = [csm_addr].[addr_prop]," & _
"Ar_Addr.Num1 = [csm_addr].[addr_stnumf]," & _
"Ar_Addr.Num2 = [csm_addr].[addr_stnumt]," & _
"Ar_Addr.dir = [csm_addr].[addr_stdir]," & _
"Ar_Addr.street = [csm_addr].[addr_stname]," & _
"Ar_Addr.unit = [csm_addr].[addr_stunit]," & _
"Ar_Addr.city = [csm_addr].[addr_city]," & _
"Ar_Addr.zip = [csm_addr].[addr_zip]"
DoCmd.RunSQL SQL1
This worked when I had just one Primary Key
now TableA needs fields 1 and 2 to create a primary/composite key
and I want to match that on TableB field 1 and 2
Any Advice??
TIA
I now have to do another update query but this time the Primary key is two fields in both TableA and TableB
How do you code that?
This is what I have
Dim SQL1 As String
SQL1 = "Update A_Addr" & " RIGHT JOIN csm_addr " & _
"ON Ar_Addr.Key = csm_addr.addr_prop " & _
"SET Ar_Addr.Key = [csm_addr].[addr_prop]," & _
"Ar_Addr.Num1 = [csm_addr].[addr_stnumf]," & _
"Ar_Addr.Num2 = [csm_addr].[addr_stnumt]," & _
"Ar_Addr.dir = [csm_addr].[addr_stdir]," & _
"Ar_Addr.street = [csm_addr].[addr_stname]," & _
"Ar_Addr.unit = [csm_addr].[addr_stunit]," & _
"Ar_Addr.city = [csm_addr].[addr_city]," & _
"Ar_Addr.zip = [csm_addr].[addr_zip]"
DoCmd.RunSQL SQL1
This worked when I had just one Primary Key
now TableA needs fields 1 and 2 to create a primary/composite key
and I want to match that on TableB field 1 and 2
Any Advice??
TIA