Normal Topic Show specific tab based on code? (Read 899 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Show specific tab based on code?
Aug 8th, 2007 at 3:34pm
Print Post Print Post  
My Vehicles database tracks 3 types of vehicle: Trucks, Forklifts, and Cranes.  Each type of vehicle has a code (T, F, C) and each type has a specific tab on the form (TabPage, TapePage0, TabPage1) which contains elements that track items specific to the vehicle.

What on-form-entry command would I use to have the specific tab presented to the user, based on the code?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Show specific tab based on code?
Reply #1 - Aug 8th, 2007 at 3:38pm
Print Post Print Post  
GoToTabPage.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Show specific tab based on code?
Reply #2 - Aug 8th, 2007 at 3:52pm
Print Post Print Post  
Thank you.  This one is tricky; I have not used the Attributes Table before.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Show specific tab based on code?
Reply #3 - Aug 8th, 2007 at 4:29pm
Print Post Print Post  
My thanks to Robert Scott for his advice with this command.

I'm not sure who to mention this to, but the book is a bit vague in regards to determining the Integer that is required for this command.  The example given is GotoTabPage(LE17, 4), and the description says that this references TabPage4, which led me to believe that the number tacked onto TabPage was the one to be used when referencing the particular tab page.  However, and thanks again to Robert, the correct number is reached by counting across the tabs.  So the first tab page is 1, the second is 2, and so on.  Until I was made aware of this I could not get the command to work for me.  I was initially stumped by how I would refer to the first tab page, which has no number; it is just TabPage.

The book's example of GotoTabPage(LE17, 4) as  tab page 4 would not, in my experience, refer to the 4th tab page, as counted across.  It would actually refer to tab page 2, as TabPage2 would be the fourth one across (TabPage, TabPage0, TabPage1, TabPage2....).  To get to TabPage4 you would need to reference GotoTabPage(LE17, 6).

Of course, this is all based on the assumption that you are creating tab pages sequentially, one next to the other.  If one starts putting tabs on tabs the TabPage#'s would be totally out of sequence.  So I think the book needs to be a bit clearer on how one determines the number of the tab you want displayed.
  

**
Captain Infinity
Back to top
IP Logged