K
Kerry Miller
I have a database, part of which contains the following tables:
tblVolunteer(Volunteer ID, First Name, Last Name, etc.)
tblHours(Volunteer ID, Program ID, Date, Hours)
tblProgram(Program ID, Program Name)
Please note that
The primary keys are the ID fields. I have designed a form (frmVolunteer)
which has a subform (sfrmHours). The forms are linked by the Volunteer ID
fields. Everything works fine. My only problem is when a user adds hours
without first adding a volunteer, it produces a key violation that Access
traps and displays a dialog box which reads "Index or primary key cannot
contain a null value" (this is a good thing). However I would like to trap
this error before Access and display my own dialog. I have tried every
technique I know and have searched help thoroughly. I'm stumped. I don't
know where or how to implement the error trap. Any help would be greatly
appreciated.
TIA,
K Miller
tblVolunteer(Volunteer ID, First Name, Last Name, etc.)
tblHours(Volunteer ID, Program ID, Date, Hours)
tblProgram(Program ID, Program Name)
Please note that
The primary keys are the ID fields. I have designed a form (frmVolunteer)
which has a subform (sfrmHours). The forms are linked by the Volunteer ID
fields. Everything works fine. My only problem is when a user adds hours
without first adding a volunteer, it produces a key violation that Access
traps and displays a dialog box which reads "Index or primary key cannot
contain a null value" (this is a good thing). However I would like to trap
this error before Access and display my own dialog. I have tried every
technique I know and have searched help thoroughly. I'm stumped. I don't
know where or how to implement the error trap. Any help would be greatly
appreciated.
TIA,
K Miller