0
votes

Scenario: Unbound master form with two subforms, both bound to tables that share the same ID. The subforms are tied together via an unbound field txtID=[SubForm1]![ID] on MasterForm and SubForm2 Link Master Fields = txtID & Link Child Fields = ID, as describes here. SubForm1 has record navigaion. SubForm2 always shows the record with the same ID as the record in SubForm1 (if any) = works as intended.

I implemented a routine to compare the records (which partially have the same data fields - unfortunately I've to work with these two data sources), highlighting differences - works as intended.

Problem: calling this comparison from Form_Current() in SubForm1 revealed unexpected behaviour: the event fires and the comparison is done before SubForm2 is updated (=> the comparison goes wrong).

Pausing code execution for some seconds before calling the comprison routine - I tested that out of curiosity - shows that sometimes the update of SubForm2 finishes before code execution continues, and sometimes not.

1

1 Answers

0
votes

My solution: I call the code from SubForm2 Current event.

Another possibility would be to switch over to a bound master form displaying the data that is displayed in my SubForm1, with the other data in a SubForm as usual - as far as I tried, this SubForm always has already updated before the code called from the master form's Current event executes.