Hi all,
I have a Header form (tblEvent) and a revised Detail subform (tblEventGuest) on which guests can be clocked in and out of the event.
The tblEvent table has a one-to-many relationship with the tblEventGuest table.
The subform has a linked master/child field of the EventID.
The issue is that the linked master/child field is Null when no guests are clocked in yet.
This is probably because tblEventGuest doesn't contain records with the specific EventID yet.
This was not a problem in the previous subform (this was a continous form default view) because before a record was inserted, the EventID was added to the subform.
Now with the revised subform i am using a 'single form' as default view which contains two subforms in which the left subform contains the absent guests and the right subform containing the guests which are present on the event.
Between the subforms i have buttons to clock in selected absent guests which are then inserted to the present guests.
For this i am executing an "INSERT TO" which uses EventID as one of its values.
I get the EventID from Me![EventID] which gets the field value via the linked master/child field.
The problem here is when no EventGuest (detail) records exist yet which sets the linked field to Null in the subform.
I know i could solve this by calling me.Parent![EventID] from the subform which i would like to prevent in my code.
For me the expeced behaviour of a linked field should be that when the master field contains a value that the child field also should contain that value.
Is there a way to link the EventID when the detail subform has no records?
~ Jarich
Upper is master form, Lower is Child subform:
Event header which contains guest records in child subform
Event header which has no guest records in child subform
I have a Header form (tblEvent) and a revised Detail subform (tblEventGuest) on which guests can be clocked in and out of the event.
The tblEvent table has a one-to-many relationship with the tblEventGuest table.
The subform has a linked master/child field of the EventID.
The issue is that the linked master/child field is Null when no guests are clocked in yet.
This is probably because tblEventGuest doesn't contain records with the specific EventID yet.
This was not a problem in the previous subform (this was a continous form default view) because before a record was inserted, the EventID was added to the subform.
Now with the revised subform i am using a 'single form' as default view which contains two subforms in which the left subform contains the absent guests and the right subform containing the guests which are present on the event.
Between the subforms i have buttons to clock in selected absent guests which are then inserted to the present guests.
For this i am executing an "INSERT TO" which uses EventID as one of its values.
I get the EventID from Me![EventID] which gets the field value via the linked master/child field.
The problem here is when no EventGuest (detail) records exist yet which sets the linked field to Null in the subform.
I know i could solve this by calling me.Parent![EventID] from the subform which i would like to prevent in my code.
For me the expeced behaviour of a linked field should be that when the master field contains a value that the child field also should contain that value.
Is there a way to link the EventID when the detail subform has no records?
~ Jarich
Upper is master form, Lower is Child subform: