jeremie_ingram
Registered User.
- Local time
- Yesterday, 19:02
- Joined
- Jan 30, 2003
- Messages
- 437
I have a system set up to track the progress on certain items. I import all of the data for all items from another system so as to eliminate unnecessary data entry. This import will occur once a year and will overwrite the existing data.
Only a small percentage from the imported records will actually be needed but all are brought in because there is no way of knowing what is or is not needed in advance. This data changes yearly and the imported data is set to overwrite the existing data each year.
What I have is a button that triggers a query that will transfer (append) the data from one table to a secondary table based on the user input.
What I would like to do is
1. Ensure the record exists in the imported dataset.
2. See if the record already exists in the secondary table.
3. Give the appropriate message to the user according to the previous 2 points, and if all is good simply append the record.
Here is an example
tbl_1
- PIN
- AYEAR
- FName
- LName
tbl_2
- PIN
- AYEAR
- FName
- LName
If the record does not exist in table 1, then msgbox: The record does not exist.
If the record does exist in table 2 (by PIN and AYEAR), then msgbox: The record already exists.
To add a twist....
Since all records is tbl_1 will have the same AYEAR, I would like to use that within the criteria for checking in tbl_2. Since tbl_2 will keep the records it is possible to have one record (PIN) appear multiple times but with different years.
I hope this makes sense. I have looked at MANY posts covering DCOUNT but cannot see how to append it within my code to get it to check the separate tables and apply the appropriate actions. Am I barking up the wrong tree?
Only a small percentage from the imported records will actually be needed but all are brought in because there is no way of knowing what is or is not needed in advance. This data changes yearly and the imported data is set to overwrite the existing data each year.
What I have is a button that triggers a query that will transfer (append) the data from one table to a secondary table based on the user input.
What I would like to do is
1. Ensure the record exists in the imported dataset.
2. See if the record already exists in the secondary table.
3. Give the appropriate message to the user according to the previous 2 points, and if all is good simply append the record.
Here is an example
tbl_1
- PIN
- AYEAR
- FName
- LName
tbl_2
- PIN
- AYEAR
- FName
- LName
If the record does not exist in table 1, then msgbox: The record does not exist.
If the record does exist in table 2 (by PIN and AYEAR), then msgbox: The record already exists.
To add a twist....
Since all records is tbl_1 will have the same AYEAR, I would like to use that within the criteria for checking in tbl_2. Since tbl_2 will keep the records it is possible to have one record (PIN) appear multiple times but with different years.
I hope this makes sense. I have looked at MANY posts covering DCOUNT but cannot see how to append it within my code to get it to check the separate tables and apply the appropriate actions. Am I barking up the wrong tree?