prissypan Posted March 12, 2004 Posted March 12, 2004 Hi guys, I urgently need to have this problem solved. I have a 2 files, one that keep track of the resellers and the other stores the salesperson record. The records are linked by unique serial number, after the admin enter the reseller details, admin will have to assign a new unique serial number for the salesperson as well. The serial number for the saleperson looks like this : 0001-001 ->companyA salesman 1 0001-002 ->companyA salesman 2 0002-001 ->companyB salesman 1 0002-002 ->companyB salesman 2 0002-003 ->companyB salesman 3 What i have to do now is for every reseller, when i add a new salesperson, the salesperson number starts from the number of the last record. My brain has freezed so all help would be greatly appreciated! Pris Version: v6.x Platform: Windows 95/98
RalphL Posted March 12, 2004 Posted March 12, 2004 I can see a need for the Company ID to be the primary key in the company fiile and foreign key in the salesperson file. I would also have a SalespersonID as the primary key in the salesperson file that is just a serial number. A serial number as you propose is less reliable than the built-in auto entered serial number.
stanley Posted March 12, 2004 Posted March 12, 2004 Pris: I agree with Ralph. Use the serial number you are proposing for in-house referencing, but as far as your relationships go, use an auto-entered serial number to ensure uniqueness. -Stanley
Recommended Posts
This topic is 7630 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now