T
tlyczko
I am working on an audits database.
The main table, Audits, has an AuditID primary key.
Another table, 1:1 relationship, ProgramAudits, has AuditID as a
foreign key.
I have a master/main form for Audits data, and a child/sub form for
ProgramAudits data.
I put a subform for ProgramAudits onto the Audits table form, and the
following code in the OnCurrent event to grab the AuditID field from
the main form and put it into the AuditID field of the ProgramAudits
subform:
Private Sub Form_Current()
' automagically grab the AuditID and put it in the right field
Me.AuditID = Form.Parent.[AuditID]
Me.Refresh
End Sub
Me is the ProgramAudits subform.
I only want the ProgramAudits table to have one record per Audits table
record, is there a better event or means to achieve what I want to do??
Or is there some uncomplicated way to check if the ProgramAudits table
already has a record corresponding to an Audits table record??
Should I enforce my end users to always manually add the one new
ProgramAudits record per each Audits table record??
One reason I ask is that the above event causes a new record to be
added each time the Audits table main form is opened, and I don't want
to do that, setting AllowAdditions to false for the subform doesn't
work.
I've looked on the forum but so far have not found the right way to
search the groups to know if anyone has solved this question.
Thank you for reading this,
Tom
The main table, Audits, has an AuditID primary key.
Another table, 1:1 relationship, ProgramAudits, has AuditID as a
foreign key.
I have a master/main form for Audits data, and a child/sub form for
ProgramAudits data.
I put a subform for ProgramAudits onto the Audits table form, and the
following code in the OnCurrent event to grab the AuditID field from
the main form and put it into the AuditID field of the ProgramAudits
subform:
Private Sub Form_Current()
' automagically grab the AuditID and put it in the right field
Me.AuditID = Form.Parent.[AuditID]
Me.Refresh
End Sub
Me is the ProgramAudits subform.
I only want the ProgramAudits table to have one record per Audits table
record, is there a better event or means to achieve what I want to do??
Or is there some uncomplicated way to check if the ProgramAudits table
already has a record corresponding to an Audits table record??
Should I enforce my end users to always manually add the one new
ProgramAudits record per each Audits table record??
One reason I ask is that the above event causes a new record to be
added each time the Audits table main form is opened, and I don't want
to do that, setting AllowAdditions to false for the subform doesn't
work.
I've looked on the forum but so far have not found the right way to
search the groups to know if anyone has solved this question.
Thank you for reading this,
Tom