Subform to form - code won't catch up

  • Thread starter Thread starter Robin
  • Start date Start date
R

Robin

Hello,

Using 2002 and 2003:
I have a main form with a subform having several buttons. As the user
clicks on various lists on the SUBFORM, the button captions change. When a
button is clicked, code is run based on the button caption (using Select
Case). The MAIN form also has a list that when clicked, changes a couple of
the subform button captions. (Most of the work/code pertains to the subform
but I need to use a couple of the buttons for something specific to the MAIN
form list.)

Here's the problem:
When I'm in the SUBFORM and click on the MAIN form list, the button captions
change appropriately. But, when I click one of the buttons, the code for the
PREVIOUS button caption runs. If I click once on the MAIN form list, then
click again on the list (NOT a double click), the code runs for the NEW
caption.

I first had the code to recaption the buttons on the OnClick event of the
MAIN form list. Then I moved it to the GotFocus event. Then I tried adding
SetFocus, Refresh, and others to the code before the Select Case code. It
still runs the code for the PREVIOUS caption. Also, I do not have any
problems with the changing button captions when moving around the lists on
the SUBFORM. Only when I move to the MAIN form.

Further Info:
The main form has a tab control with this same "setup" on the two other
tabs, so there are actually three main form lists and three subforms with
buttons. This problem is occurring on all three tabs.

I cannot add buttons to the main form (it already has eight) and the layout
is how we need it.

Any help would be appreciated.

Thank you,
Robin
 
To any interested,

I think I figured it out. When I moved focus to main form list, all was
fine. When I clicked on the subform button, it shifted the focus back to the
subform and, subsequently, whatever list was in focus when I left the
subform. (Or when I click on ANY part of the subform.) So in actuality, it
wasn't the previous code that was firing, but the button captions were being
changed (back to the previous lists button captions) the instant I clicked on
the button. (Too quick to see before a popup form opened and obscured the
buttons.)

Whew.
Robin
 
Back
Top