D
dx101
Guest
I have a microsoft access 2k project attached to SQL Desktop.
The database is for a card issue scheme. I have most of it working but am finding myself out of my depth with the calculation for the expiry date.
I have a form that has the main form [frm_customers] and a subform [frm_cardissues]. The main form is attached to the main table [tbl_customers] and the subform attached to [tbl_cardissues]
The dataentry form works fine and when the user enters the data from the subform I want to auto complete a couple of fields and set the focus to the end of the form.
On the main form [frm_customers] I have the date of birth field [DOB]
On the subform [frm_cardissues] I have fields [ISSUEDATE] AND [EXPIRYDATE]. When the user enters the card type (Under 17's and 17to18) I want to complete the two fields.
The rules for the expiry date are:
The cards are issued to children for discounts to services.
Type1 - up to 15yr old.
Type2 - 16 - 17 yr old.
The cards don't expire according to DOB but the 31 August.
example:
1. A 15 yr olds (born 1 Aug) type1 card will be valid until 31 Aug (so he gets month at 16 on the old card), They then have to get a Type2 card.
2. A 15 yr old (born 1 Sep) type1 card will be valid un 31 Aug the following year (so he gets almost a year at 16 on Type1 card)
Note: Cards have a maximum life of three years (so a 11 year olds card will expire and have to be renewed for the final year).
This is due to how the UK schools decide which year children are allocated. So, basically I want the expiry date (which will always be 31 Aug) to be auto completed allowing the user to write that date on the card without having to manually calculate the expiry.
I am just baffled on how i could achieve this so any advice would be appreciated... Note I want to be able to put this code on the input form so the ExpiryDate field is auto completed.
Thanks for anyone who can make any suggestions. Sorry this question is so long winded...
DX101
The database is for a card issue scheme. I have most of it working but am finding myself out of my depth with the calculation for the expiry date.
I have a form that has the main form [frm_customers] and a subform [frm_cardissues]. The main form is attached to the main table [tbl_customers] and the subform attached to [tbl_cardissues]
The dataentry form works fine and when the user enters the data from the subform I want to auto complete a couple of fields and set the focus to the end of the form.
On the main form [frm_customers] I have the date of birth field [DOB]
On the subform [frm_cardissues] I have fields [ISSUEDATE] AND [EXPIRYDATE]. When the user enters the card type (Under 17's and 17to18) I want to complete the two fields.
The rules for the expiry date are:
The cards are issued to children for discounts to services.
Type1 - up to 15yr old.
Type2 - 16 - 17 yr old.
The cards don't expire according to DOB but the 31 August.
example:
1. A 15 yr olds (born 1 Aug) type1 card will be valid until 31 Aug (so he gets month at 16 on the old card), They then have to get a Type2 card.
2. A 15 yr old (born 1 Sep) type1 card will be valid un 31 Aug the following year (so he gets almost a year at 16 on Type1 card)
Note: Cards have a maximum life of three years (so a 11 year olds card will expire and have to be renewed for the final year).
This is due to how the UK schools decide which year children are allocated. So, basically I want the expiry date (which will always be 31 Aug) to be auto completed allowing the user to write that date on the card without having to manually calculate the expiry.
I am just baffled on how i could achieve this so any advice would be appreciated... Note I want to be able to put this code on the input form so the ExpiryDate field is auto completed.
Thanks for anyone who can make any suggestions. Sorry this question is so long winded...
DX101