skidude2000
Registered User.
- Local time
- Today, 08:24
- Joined
- Jun 8, 2012
- Messages
- 10
I am having some trouble checking a table. Here is my situation:
I have a database desinged to keep inventory of computers in my building. I have two tables withing this db called tblGroupAcct and tblAcctLink. tblGroupAcct contains all of the group accounts and their info; tblAcctLink contains a record for each instance of a group account on a computer in building. When I delete a computer from the database or remove it from a group account, the record in tblAcctLink linking that computer to a group from tblGroupAcct will get deleted.
Now, here's my issue:
When the last instance of a group in tblAcctLink is deleted, I need the db to prompt the user to remove the entire group account from tblGroupAcct. I have a form that allows the deletion of computers or the removal of a group, and on save of the changes (either delete the computer or remove the group), I want the db to check to see if there is a record of a group account in tblGroupAcct that has a corresponding link to a record in tblAcctLink. If there is a corresponding record, then ignore it. If there is no corresponding record, then prompt the user to delet the group from tblGroupAcct. It must loop through to check every group in tblGroupAcct before closing the forms.
What seems to be my solution is assigning all groups from tblGroupAcct to an array and assigning all records in tblAcctLink to another array. If I could then compare the arrays, and have the db tell me which parts of array A do not exist in array B, that would be great. But I'm not sure how to do that.
Please HELP!! I have tried many different ways of implementing this in VBA, and none have worked. I've been on this issue since 7:30 A.M. and it's almost 2:00 P.M.:banghead: Also, if my idea of comparing arrays does not make sense, I would appreciate any suggestions on how to fix my issue.
If you need clarification, please ask.
I have a database desinged to keep inventory of computers in my building. I have two tables withing this db called tblGroupAcct and tblAcctLink. tblGroupAcct contains all of the group accounts and their info; tblAcctLink contains a record for each instance of a group account on a computer in building. When I delete a computer from the database or remove it from a group account, the record in tblAcctLink linking that computer to a group from tblGroupAcct will get deleted.
Now, here's my issue:
When the last instance of a group in tblAcctLink is deleted, I need the db to prompt the user to remove the entire group account from tblGroupAcct. I have a form that allows the deletion of computers or the removal of a group, and on save of the changes (either delete the computer or remove the group), I want the db to check to see if there is a record of a group account in tblGroupAcct that has a corresponding link to a record in tblAcctLink. If there is a corresponding record, then ignore it. If there is no corresponding record, then prompt the user to delet the group from tblGroupAcct. It must loop through to check every group in tblGroupAcct before closing the forms.
What seems to be my solution is assigning all groups from tblGroupAcct to an array and assigning all records in tblAcctLink to another array. If I could then compare the arrays, and have the db tell me which parts of array A do not exist in array B, that would be great. But I'm not sure how to do that.
Please HELP!! I have tried many different ways of implementing this in VBA, and none have worked. I've been on this issue since 7:30 A.M. and it's almost 2:00 P.M.:banghead: Also, if my idea of comparing arrays does not make sense, I would appreciate any suggestions on how to fix my issue.
If you need clarification, please ask.