I have this in a query and it results in almost 4,000 records from Table1
I then tried to put this SQL into the VB behind my form.
When I run it, it is successful but it doesn’t return any records.
I’m trying to pull all of the records from table1 where the right 6 digits of the RunIndex = 070108 and where there are no corresponding record on table2. Any suggestions on how to make this work in the VB behind the form or what I may have done wrong?
TIA
Code:
SELECT * FROM Table1 LEFT JOIN Table2 ON Table1.RunIndex = Table2.RunIndex WHERE (((Right([Table1.RunIndex],6))="070108") AND ((Table2.RunIndex) is null));
I then tried to put this SQL into the VB behind my form.
Code:
GetRecs = "SELECT * FROM Table1 LEFT JOIN Table2 ON Table1.RunIndex = Table2.RunIndex WHERE Right([Table1.RunIndex],6)= "070108" And Table2.RunIndex is null;"
Set nr = CurrentDb.openRecordset(GetRecs)
I’m trying to pull all of the records from table1 where the right 6 digits of the RunIndex = 070108 and where there are no corresponding record on table2. Any suggestions on how to make this work in the VB behind the form or what I may have done wrong?
TIA