My application starts with a Main Switchboard. Clicking a command button opens a form with a tab control. The second tab of the tab control contains a subform with an image control on it. My problem is that the OnCurrent event of this subform runs twice whenever the user moves between records on the first (main) tab (using PgUp/PgDn or the navigation buttons) of the tab control. Because some of the images being displayed in the image control are large, it takes time (and the importing graphic progress bar automatically pops up). Interestingly, OnCurrent doesn't run twice when the user first moves to the tab control form from the Main Switchboard.
I've stepped through the code to try to see what triggers the second OnCurrent event, but to no avail. Execution reaches the Exit Sub command on the first pass and then goes right back to the top of the Sub for a second pass. I've tried commenting out everything in the OnCurrent event and it still runs through it twice so nothing in the OnCurrent event would appear to be triggering itself.
If I run the tab control form by itself (not from the Main Switchboard), the OnCurrent event of the subform works fine (i.e. runs once). I have a second tab control form with a subform that is invoked from the Main Switchboard. It too runs the OnCurrent event twice, but it isn't a big issue as it runs so quickly without any messages.
Does anyone have any ideas why the OnCurrent event would run twice in this situation and how to prevent it?
Thanks!
dftjsn
I've stepped through the code to try to see what triggers the second OnCurrent event, but to no avail. Execution reaches the Exit Sub command on the first pass and then goes right back to the top of the Sub for a second pass. I've tried commenting out everything in the OnCurrent event and it still runs through it twice so nothing in the OnCurrent event would appear to be triggering itself.
If I run the tab control form by itself (not from the Main Switchboard), the OnCurrent event of the subform works fine (i.e. runs once). I have a second tab control form with a subform that is invoked from the Main Switchboard. It too runs the OnCurrent event twice, but it isn't a big issue as it runs so quickly without any messages.
Does anyone have any ideas why the OnCurrent event would run twice in this situation and how to prevent it?
Thanks!
dftjsn