A
Allan March
Hi there,
I have been working on a database for my golf club that records then prints
prize vouchers for our competitions. I have an "Event Table", primary key of
EventID in which all the competition details are entered. The "Event Table"
has a 'VoucherID' foreign key field which gives a one-to-many relationship
with the "Voucher Table". That is, for any Event you can have more than one
prize voucher.
The "Event" form is based on a query of the "Event Table" and has two combo
dropdown boxes that allow you to select 'Event Type' and the 'Employee'. I
have not- in-list procedures for these combo boxes and they work fine.
The "Voucher" form, primary key of VoucherID, is linked to the 'Event' form
as a subform, the many side of the above relationship. The "Voucher Table"
has four foreign key fields of which the "Member" and "Vistor" fields are
giving me a problem.
Again the 'Voucher' form is based on a query of the "Voucher Table" and
related fields in the four foreign key fields/tables. Two of the foreign
field key present no problem as the have attached combo boxes and are looking
at only one piece of information from their tables.
My problem is that when I set up the voucher form and create combo drop down
boxes for the "Member" or "Visitor" (which fills in related information on
the form) I have to choose a name from both combo boxes for the record to be
saved and printed as a voucher. If I leave the "Visitor" combo box blank I
get the following error message 'You cannot add or change a record because a
related record is required in table Visitors' and vice a versa for the
'Member' combo box.
Is there away around this problem? The way I originally wanted to do the
form was to have an option group on the voucher form that enabled/disabled
either the 'Member' combo box or the 'Visitor' combo box depending on the
choice made in the option group but this approach doesn't work. If the
problem is because I have the two foreign keys in the "Voucher Table" should
I create another table for Visitors Vouchers only and have this linked to
Event Table as the same way as above and thus have two subforms on the Event
form. Can you have two subforms related to the Event form by the EventID
primary field?
If anyone has any suggestions on how to best overcome this problem or what I
am doing wrong in the first place I would like to thank you in advance for
your reply.
Regards
Allan March
I have been working on a database for my golf club that records then prints
prize vouchers for our competitions. I have an "Event Table", primary key of
EventID in which all the competition details are entered. The "Event Table"
has a 'VoucherID' foreign key field which gives a one-to-many relationship
with the "Voucher Table". That is, for any Event you can have more than one
prize voucher.
The "Event" form is based on a query of the "Event Table" and has two combo
dropdown boxes that allow you to select 'Event Type' and the 'Employee'. I
have not- in-list procedures for these combo boxes and they work fine.
The "Voucher" form, primary key of VoucherID, is linked to the 'Event' form
as a subform, the many side of the above relationship. The "Voucher Table"
has four foreign key fields of which the "Member" and "Vistor" fields are
giving me a problem.
Again the 'Voucher' form is based on a query of the "Voucher Table" and
related fields in the four foreign key fields/tables. Two of the foreign
field key present no problem as the have attached combo boxes and are looking
at only one piece of information from their tables.
My problem is that when I set up the voucher form and create combo drop down
boxes for the "Member" or "Visitor" (which fills in related information on
the form) I have to choose a name from both combo boxes for the record to be
saved and printed as a voucher. If I leave the "Visitor" combo box blank I
get the following error message 'You cannot add or change a record because a
related record is required in table Visitors' and vice a versa for the
'Member' combo box.
Is there away around this problem? The way I originally wanted to do the
form was to have an option group on the voucher form that enabled/disabled
either the 'Member' combo box or the 'Visitor' combo box depending on the
choice made in the option group but this approach doesn't work. If the
problem is because I have the two foreign keys in the "Voucher Table" should
I create another table for Visitors Vouchers only and have this linked to
Event Table as the same way as above and thus have two subforms on the Event
form. Can you have two subforms related to the Event form by the EventID
primary field?
If anyone has any suggestions on how to best overcome this problem or what I
am doing wrong in the first place I would like to thank you in advance for
your reply.
Regards
Allan March