W
wallymeister
I have a query that is comparing 2 tables (Models & Parts) [ModelID] to
[ModelID] and only shows records in Models table that don't have a matching
record in Parts table. Here is the SQL
SELECT Models.ModelID
FROM Models LEFT JOIN Parts ON Models.ModelID = Parts.ModelID
WHERE (((Parts.ModelID) Is Null));
Then I have a Totals qry that Counts the records found in above qry.
I want to;
When user close this form (onclose event) place code that runs Totals qry's
and then asks the user if new records created were intentional or not. Then,
either run a delete qry or run an append qry that adds the appropriate
records to the parts table. I have the append/delete queries working (just
not placed in code to run behind form. I don't know how to use the value
returned by Totals qry to display a message that asks user if (e.g) 3 records
have been added do you wish to proceed etc, etc)
This is all to keep the tables from having orphan records, if indeed a new
model is added then there must be new matching parts records.
Hope I have explained well enough for someone to help. I've forgot so much
about Access than I'd like to admit.
Thanks,
wally
[ModelID] and only shows records in Models table that don't have a matching
record in Parts table. Here is the SQL
SELECT Models.ModelID
FROM Models LEFT JOIN Parts ON Models.ModelID = Parts.ModelID
WHERE (((Parts.ModelID) Is Null));
Then I have a Totals qry that Counts the records found in above qry.
I want to;
When user close this form (onclose event) place code that runs Totals qry's
and then asks the user if new records created were intentional or not. Then,
either run a delete qry or run an append qry that adds the appropriate
records to the parts table. I have the append/delete queries working (just
not placed in code to run behind form. I don't know how to use the value
returned by Totals qry to display a message that asks user if (e.g) 3 records
have been added do you wish to proceed etc, etc)
This is all to keep the tables from having orphan records, if indeed a new
model is added then there must be new matching parts records.
Hope I have explained well enough for someone to help. I've forgot so much
about Access than I'd like to admit.
Thanks,
wally