GrandMasterTuck
In need of medication
- Local time
- Today, 10:55
- Joined
- May 4, 2013
- Messages
- 129
Hi folks. A brain teaser:
I have a main form called frmMain. On it is a tab-control with two tabs. Tab 1, called INFO, has a subform called ctlPeople. Tab 2, called CARD, has a subform, called ctlCard.
At the top of frmMain, above the tab control, there is a combo-box that's set to fetch the ID numbers of all the employees in my main Employees table. This combo-box has an AfterUpdate event with a macro that is supposed to perform a SearchForRecord action on both ctlPeople AND on ctlCard. And it works perfectly. I can open the main form, select a record in the combo box, and when I tab out, both ctlPeople and ctlCard update to show me the record I selected.
Here's the problem: ctlCard's record list fields have double-click actions that set a SourceObject on a second control that's elsewhere on Tab 2 (CARD). Once I double-click a record, then go back to my main form combo box, it now will only refresh Tab 1 and ctlPeople, but ctlCard stops updating, and 'sticks' on the recordlist that contains the one I double-clicked. The only way I can get it to stop this is to exit the form and reopen it.
I've tried the following:
It seems like my forms are 'forgetting' where to find ctlCard if I do the double-click action on a record within ctlCard, and it stops updating. As long as I don't double-click a record, though, the refresh works perfect on both tabs. What could be causing this, and how do I get around it? Thanks!
I have a main form called frmMain. On it is a tab-control with two tabs. Tab 1, called INFO, has a subform called ctlPeople. Tab 2, called CARD, has a subform, called ctlCard.
At the top of frmMain, above the tab control, there is a combo-box that's set to fetch the ID numbers of all the employees in my main Employees table. This combo-box has an AfterUpdate event with a macro that is supposed to perform a SearchForRecord action on both ctlPeople AND on ctlCard. And it works perfectly. I can open the main form, select a record in the combo box, and when I tab out, both ctlPeople and ctlCard update to show me the record I selected.
Here's the problem: ctlCard's record list fields have double-click actions that set a SourceObject on a second control that's elsewhere on Tab 2 (CARD). Once I double-click a record, then go back to my main form combo box, it now will only refresh Tab 1 and ctlPeople, but ctlCard stops updating, and 'sticks' on the recordlist that contains the one I double-clicked. The only way I can get it to stop this is to exit the form and reopen it.
I've tried the following:
- Putting 'SelectObject' and 'GoToControl' actions in front of each of the 'SearchForRecord' actions in the macro... no dice
- Adding 'SelectObject' and 'Requery' commands after the AfterUpdate commands for the Combo Box... nothing
- Adding 'Requery' commands at the end of the SearchForRecord commands in the double click event of ctlCard's fields, and this gives me a 'No field named ctlCard in the current record' error. I even tried it with the full reference, Form!frmMain... etc. Still errors
It seems like my forms are 'forgetting' where to find ctlCard if I do the double-click action on a record within ctlCard, and it stops updating. As long as I don't double-click a record, though, the refresh works perfect on both tabs. What could be causing this, and how do I get around it? Thanks!