UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Tab controls and events    
 
   
KurtW
post Jan 23 2006, 06:15 PM
Post #1

UtterAccess Guru
Posts: 516
From: N. Colorado



Hey all:

I need a bit of help with tab controls. I have a main form with three tabs on it. (1 tab control, 3 separate tabs.) The main form has a generic status message field at the bottom that is set through a public/global function, so this field services all tabs.

I'd like the message text reset to blank when the user switches tabs. I have tried calling the message function in the OnClick event of the 3rd tab, like so (the tab is called EDIT:

Private Sub Edit_Click()
Call subSetStatusMsg("", "Hide", 0)
End Sub

… but nothing happens. Is there something obvious I am missing? Is there a better way to handle this?

Thanks

Kurt
Go to the top of the page
 
+
fredrisg
post Jan 23 2006, 06:23 PM
Post #2

UtterAccess VIP
Posts: 1,795
From: LA, CA, USA



Use the OnChange event of the tab control itself . . . I do the same basic thing myself!

And if you work on a slow server, you can set up some form variables and use the OnChange event to load cbos and listboxes . . . if the user goes to a given tab . . . if not, you don't pay any penalty on opening the form. Some posters have brought this to my attention.

Finally, if you move controls from tab to tab (page to page), any events to the moved control become 'unlinked'. The code is still there but you'll have to relink it manually . . .

But I do love this control!

Steve
Go to the top of the page
 
+
Jack Cowley
post Jan 23 2006, 06:28 PM
Post #3

Retired Moderator
Posts: 37,716
From: The San Francisco Bay Area



Use the On Change event of the control itself:

Select Case NameOfYourTabControlHere
Case 0 'first tab
..do whatever..
Case 1 'second tab
...do whatever...
Case...
etc.
End Select

hth,
Jack
Go to the top of the page
 
+
KurtW
post Jan 23 2006, 06:53 PM
Post #4

UtterAccess Guru
Posts: 516
From: N. Colorado



Thanks to you both! That was exactly what I needed. Fantastic.

Kurt
Go to the top of the page
 
+
Jack Cowley
post Jan 24 2006, 10:29 AM
Post #5

Retired Moderator
Posts: 37,716
From: The San Francisco Bay Area



You are welcome and good luck with this...

Jack
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 01:39 AM