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

how to dynamically change the tab that is showing based on criteria in the form

P: 2
I have a form that has a control named Division that has 4 separate values and I want the tab control on the page to display the appropriate tab for the division that comes up. this is the code as I have written it:

Private Sub Form_Current()
Select Case Me.Division
Case "Best Cheerleader"
Me!TabCtl12.Value = 0
Case "Best Dancer"
Me!TabCtl12.Value = 1
Case "Best Jumps"
Me!TabCtl12.Value = 2
Case "Best Tumbling Pass"
Me!TabCtl12.Value = 3
Case Else
MsgBox "you idiot"
End Select

Yet to no end! all that happens is that the form gets a bit fuzzy and messed up. Please assist if you can
Feb 25 '10 #1
Share this Question
Share on Google+
4 Replies


TheSmileyCoder
Expert Mod 100+
P: 2,321
Hi and welcome to Bytes

What version of Access are you using?

Please remember to use the [code][/code] tags aroud your code, as it makes it easier to read.

I tried some simple code code, and it seemed to work fine. Maybe you have some other code running as well which messes it up.
Expand|Select|Wrap|Line Numbers
  1.     If Me.ctrlTab.Value = 0 Then
  2.         Me.ctrlTab.Value = 1
  3.         Else
  4.         Me.ctrlTab.Value = 0
  5.     End If
Feb 25 '10 #2

P: 5
I had the same problem when trying to change the tab based on a result from the form. When i used .value it didn't work. So i tried the following with success:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2. Select Case Me.Division
  3. Case "Best Cheerleader"
  4. Me.TabCtl12 = 0
  5. Case "Best Dancer"
  6. Me.TabCtl12 = 1
  7. Case "Best Jumps"
  8. Me.TabCtl12 = 2
  9. Case "Best Tumbling Pass"
  10. Me.TabCtl12 = 3
  11. Case Else
  12. MsgBox "you idiot"
  13. End Select
  14.  
Feb 25 '10 #3

ADezii
Expert 5K+
P: 8,597

P: 2
thanks guys this helped...I went another route but accomplished essentially the same function
Feb 28 '10 #5

Post your reply

Sign in to post your reply or Sign up for a free account.