March 12, 200421 yr 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
March 12, 200421 yr 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.
March 12, 200421 yr 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
Create an account or sign in to comment