A
Amy Blankenship
I have the following situation:
I have a form structure where in one place it is necessary to reverse the
LinkMaster>LinkChild relationship. In other words, the parent form contains
the foreign key, and the child form contains the primary key. What this
means is that when a new record is created in the child form it doesn't pass
its ID back up to the parent form, because Access expects the data to flow
the other direction. However, once the record exists, it can be edited just
fine.
So I've arrived at a sort of wonky solution to get around this problem. I
have code in the current event that checks to see if there is a value in the
FK ID field. If not, it hides the subform and shows a button. That button
just launches the same subform as a dialogue and captures the new ID on
return. The standard way you do this is to cancel the close event of the
dialogue form and then actually close the form in the procedure that calls
the dialogue form. The problem I have is that the form actually is open
twice, once invisibly as a subform and once visibly standalone.
How do I distinguish in code WHICH version of the form I'm referring to.
TIA;
Amy
I have a form structure where in one place it is necessary to reverse the
LinkMaster>LinkChild relationship. In other words, the parent form contains
the foreign key, and the child form contains the primary key. What this
means is that when a new record is created in the child form it doesn't pass
its ID back up to the parent form, because Access expects the data to flow
the other direction. However, once the record exists, it can be edited just
fine.
So I've arrived at a sort of wonky solution to get around this problem. I
have code in the current event that checks to see if there is a value in the
FK ID field. If not, it hides the subform and shows a button. That button
just launches the same subform as a dialogue and captures the new ID on
return. The standard way you do this is to cancel the close event of the
dialogue form and then actually close the form in the procedure that calls
the dialogue form. The problem I have is that the form actually is open
twice, once invisibly as a subform and once visibly standalone.
How do I distinguish in code WHICH version of the form I'm referring to.
TIA;
Amy