marklane2001
Registered User.
- Local time
- Today, 19:05
- Joined
- Sep 16, 2008
- Messages
- 15
Hi
I currently have an input form called ENROL_CLASS which has 3 fields. They are:
txtPupilID
txtClassID
txtTermID
I have a button call btnEnrolStudnet. All fields have to have data in to proceed. There is a table called CLASSES_TAKEN and an insert query which runs when the btnEnrolStudent is pressed. This inserts the data on the form into the CLASSES_TAKEN field.
I want to check for duplicates first in the table before the insert takes place. Duplicates occur when all 3 fields are the same in the database not just one e.g. PUPIL ID - CLASSID -TERMID all have to be the same. The system will allow it if PUPILID and CLASSID are already in the table but the TERMID is not. All 3 fields in the table have to match the form for it to be classed as duplicate.
If it is a duplicate I would like a message box to appear to advise this and then when the message OK is pressed for the fields to be cleared once again.
Please help as I am really struggling with this.
Thanks
I currently have an input form called ENROL_CLASS which has 3 fields. They are:
txtPupilID
txtClassID
txtTermID
I have a button call btnEnrolStudnet. All fields have to have data in to proceed. There is a table called CLASSES_TAKEN and an insert query which runs when the btnEnrolStudent is pressed. This inserts the data on the form into the CLASSES_TAKEN field.
I want to check for duplicates first in the table before the insert takes place. Duplicates occur when all 3 fields are the same in the database not just one e.g. PUPIL ID - CLASSID -TERMID all have to be the same. The system will allow it if PUPILID and CLASSID are already in the table but the TERMID is not. All 3 fields in the table have to match the form for it to be classed as duplicate.
If it is a duplicate I would like a message box to appear to advise this and then when the message OK is pressed for the fields to be cleared once again.
Please help as I am really struggling with this.
Thanks