A
Atlas
Access 2003 + MS SQL Server 2000
I'm using a form to manage customers and related contracts; with one to many
relation;
all managed with a form containing a subform:
Main form: contains customers
Main subform: contains multiple contracts per customer
Each contract has a begin and end date;
By design each customer can have multiple contracts, so when checking user
input I want to be sure that date mismatches do not occur, like entering a
date across previous ended contracts:
Examples:
Correct:
CustID ContractID StartDate EndDate
1 1 01-01-2002 31-12-2002
1 2 01-01-2003 01-06-2003
1 3 02-06-2003 31-12-2003
Wrong:
CustID ContractID StartDate EndDate
1 1 01-01-2002 31-12-2002
1 2 30-12-2002 01-06-2003
1 3 01-06-2003 31-12-2003
I thought I could easily add some VBA code to query a secondary index based
on CustID+EndDate and check if allready existing, using ADO seek.
I'm on the right way or there's an easier method to do so?
If so any code sample?
Thanks
I'm using a form to manage customers and related contracts; with one to many
relation;
all managed with a form containing a subform:
Main form: contains customers
Main subform: contains multiple contracts per customer
Each contract has a begin and end date;
By design each customer can have multiple contracts, so when checking user
input I want to be sure that date mismatches do not occur, like entering a
date across previous ended contracts:
Examples:
Correct:
CustID ContractID StartDate EndDate
1 1 01-01-2002 31-12-2002
1 2 01-01-2003 01-06-2003
1 3 02-06-2003 31-12-2003
Wrong:
CustID ContractID StartDate EndDate
1 1 01-01-2002 31-12-2002
1 2 30-12-2002 01-06-2003
1 3 01-06-2003 31-12-2003
I thought I could easily add some VBA code to query a secondary index based
on CustID+EndDate and check if allready existing, using ADO seek.
I'm on the right way or there's an easier method to do so?
If so any code sample?
Thanks