By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,505 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Event When User Clicks On A Control On A Tab's Page

P: n/a
I have a several paged tab control on my form.

On each page, there are several different controls. One page may have
5 controls and the other may have 10.

Can I run specific code when one of those controls on a particular page
is clicked.

I dont have to have to put code in each controls on click event and the
Tabs Click event only fires when you click "outside" of the actual
control and somewherre on a blank part of the tab page.

Basically - I've placed a bunch of text boxes (with a flat effect) to
make them look like command buttons. Then when a user selects the
control - I want the background of the selected control to turn a
different colors to show its been selected. Ofcourse the code would
have to cycle through the rest of the controls to make sure that the
other "command buttons" are set to the unselected color.

I know option boxes would be a lot easier - but I am trying something a
little different.
Thanks,
Brian

Jan 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
BerkshireGuy wrote:
Can I run specific code when one of those controls on a particular page
is clicked.


Use the tab on change event. Each page in a tab control has a page
index property value, which is on the format tab of the page properties
window. I use it like this:

Private Sub tabWo_Change()

'If value is 9 (the advanced custom page), run the following afterupdate
event to get the rowsource for the list box

If Me.tabWo.Value = 9 Then

Me.subAdv.Form.fraOraClause_AfterUpdate

End If

End Sub

You may be able to do it by referring to other properties, but the above
works fine for me.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Whatcha doin?" - Ditto "TIM-MAY!!" - Me
Jan 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.