0
votes
DELETE 
        DISTINCTROW tbl1.*, tbl2.Name
    FROM 
        tbl1 INNER JOIN tbl2 ON tbl1.EMP_NUM = tbl2.EMP_NUM
    WHERE 
        (((tbl2.Name) Not Like [Forms]![formReports]![txtName]));

I just need to verify that my description below makes sense or if it doesn't point out why and what the statement actually does. Here is what I think it does:

Join the tables using the EMP_NUM and delete the duplicate records based on the name being different from that entered into the view "txtName" on the form "formReports."

OR

Does it delete all values from the columns in tbl1 and only the values in the field Name in tbl2 where the name entered into the form is different from that in tbl2.

Any thoughts?

1
There is a pretty good chance it will not run at all. Have you tried?Fionnuala
I can't try it because the app im working with doesn't have any test data and the tables are too big to put stuff in myself but I'll try it on a smaller table; why wouldn't this run btw?Katana24

1 Answers

1
votes

Because you are joining two tables and have fields from both tables, the DISTINCTROW is not doing anything.

You can see the documentation here that explicitly spells this out.