Hello,
Part of this post was originally posted to the forms forum of this website. My question to it was whether I needed programming to make an idea of mine to work (see below). The answer I got was yes, I did indeed need programming. My question to this forum is what the programming would look like? Also, if there are alternate criteria besides the ones given below (to get a subform to "play well" with its parent form), I would be open to hearing it.
Say for example I have the following table labeled Master:
ID: autornumber
Label: string
2nd, I have the following table labeled Slave:
ID: autonumber
Label: string
Xref: foreign key to Master.ID field
In other words, there is a one to many relationship between Master and Slave. In both tables, all fields are required.
3rd, I have a Master form with a Slave subform:
Master form:
ID: xxxxxxxxxxx
Label: xxxxxxxxxxxxxxxx
Slave subform:
ID: xxxxxxxxxxxx
Label: xxxxxxxxxxxxxxx
Xref: *** combo box ***
Finally, I need the Master form and Slave subform to have these properties:
(1) For every record in the master form, a corresponding record must exist in the subform, based on the Xref foreign key.
(2) I want to force the user to have to enter a Slave record at the same time they enter a Master record.
This is before the Master record is saved and data entry moves on to a new record.
(3) Also, I don't want the user to be able to go back to the Slave subform and delete all records.
In other words, there is always at least one record in the Slave subform for a corresponding Master form record based on the Xref foreign key.
(4) However, I want a delete button in the Master form that will delete all corresponding records in the Slave subform at the same time the Master record is deleted.
Thanks kindly,
Craig