token_remedie
Registered User.
- Local time
- Tomorrow, 02:24
- Joined
- Jul 7, 2011
- Messages
- 78
Hey all,
I am trying to find out if a record exists in a query, and if it does then run another one, I was thinking something like: while not .eof do until if strSQL = true (sql code) compare table 1 and 2 - update table 3 else next record.
Basically I've got a query that finds duplicates between two tables on two fields, and if a record from redisttable is in this query (and hence a duplicate) then i want to check location, if that's the same in both tables, ignore, however if it's different append to transactions (table 3).
Here's what I have to far:
Query:
then I tried this:
Set rs = CurrentDb.OpenRecordset("Master Without Matching redisttable")
but I dont really know what to do with it.
Hope that make sense.
I am trying to find out if a record exists in a query, and if it does then run another one, I was thinking something like: while not .eof do until if strSQL = true (sql code) compare table 1 and 2 - update table 3 else next record.
Basically I've got a query that finds duplicates between two tables on two fields, and if a record from redisttable is in this query (and hence a duplicate) then i want to check location, if that's the same in both tables, ignore, however if it's different append to transactions (table 3).
Here's what I have to far:
Query:
Code:
SELECT Master.UID, Master.[Asset Number], Master.[Serial No#], Master.LOCATION, Master.F10
FROM Master LEFT JOIN redisttable ON Master.[Asset Number] = redisttable.[Asset Number] AND Master.[serial no#] = redisttable.[serial no#]
WHERE (((redisttable.[Asset Number]) Is Not Null) AND ((redisttable.[serial no#]) Is Not Null));
Set rs = CurrentDb.OpenRecordset("Master Without Matching redisttable")
but I dont really know what to do with it.
Hope that make sense.