Solved Refreshing pressed color on navigation tabs after executing BrowseTo to navigate between tabs (1 Viewer)

autumnnew

Member
Local time
Today, 10:20
Joined
Feb 4, 2013
Messages
44
Does anyone know of a way to refresh the tab colors of a navigation control after using code to navigate to another tab?

I have code that switches to the first tab of a navigation subcontrol on my main form, but the pressed color on the previously selected tab and current tab do not refresh unless I mouse over them. Even though right tab opens correctly, the button colors don't change and it looks like previous tab is still selected/pressed. Here is the code I used:

DoCmd.BrowseTo acBrowseToForm, "NavigationTargetNameofTab1", "MainForm.NavigationSubControlName"
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:20
Joined
May 7, 2009
Messages
19,245
can you setFocus to the associate Navigation Button?
 

autumnnew

Member
Local time
Today, 10:20
Joined
Feb 4, 2013
Messages
44
Oh, derp. Yes! That fixed half the problem. Me!tabNameofTab1.SetFocus Now the color is right for the pressed button, but now how can I 'unpress' or refresh the tab of previously selected tab? I guess one workaround could be I could cycle through all the tabs and setfocus to each one at a time, but I'm sure there's something simpler than that...
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 23:20
Joined
May 7, 2009
Messages
19,245
i don't know why the "previous" tab appears as if it is selected when you issue BrowseTo command.
can you try to Refresh the Form (Me.Refresh), after BrowsingTo?
 

autumnnew

Member
Local time
Today, 10:20
Joined
Feb 4, 2013
Messages
44
Yep. That's all it needed, was Me.Refresh. 🤦‍♀️I deleted the setfocus line. Thanks again.
 

Users who are viewing this thread

Top Bottom