M
Martin \(Martin Lee\)
I have TABLE1 and TABLE2.
TABLE1 has field "DEALER CODE" , "DEALER NAME", "SALARY"
TABLE2 has field "DEALER CODE" , "VOLUME" (doesn't have "DEALER NAME")
The records in TABLE1 and TABLE2 is "one to one", linked by the field
"DEALER CODE"
And, I create QUERY3 to contain "DEALER CODE" , "DEALER NAME", "SALARY"
"VOLUME"
Now, I want to delete all the records where field "DEALER NAME"= "dealer1"
and "dealer2"
When doing this, I face such problem:
I can do this to TABLE1 with VBA DoCmd.RunSQL "DELETE * FROM TABLE1 WHERE
DEALERNAME in ('dealer1','dealer2')"
However, I can't do this to TABLE2 because TABLE2 has only the DEALER CODE
yet not have the DEALER NAME.
So, I have to delete according to QUERY3
MY QUESTION IS:
How to write a SQL VBA to delete base on QUERY3 ? (delete base on QUERY,
not base on TABLE)
Thanks!
Martin
TABLE1 has field "DEALER CODE" , "DEALER NAME", "SALARY"
TABLE2 has field "DEALER CODE" , "VOLUME" (doesn't have "DEALER NAME")
The records in TABLE1 and TABLE2 is "one to one", linked by the field
"DEALER CODE"
And, I create QUERY3 to contain "DEALER CODE" , "DEALER NAME", "SALARY"
"VOLUME"
Now, I want to delete all the records where field "DEALER NAME"= "dealer1"
and "dealer2"
When doing this, I face such problem:
I can do this to TABLE1 with VBA DoCmd.RunSQL "DELETE * FROM TABLE1 WHERE
DEALERNAME in ('dealer1','dealer2')"
However, I can't do this to TABLE2 because TABLE2 has only the DEALER CODE
yet not have the DEALER NAME.
So, I have to delete according to QUERY3
MY QUESTION IS:
How to write a SQL VBA to delete base on QUERY3 ? (delete base on QUERY,
not base on TABLE)
Thanks!
Martin