tab control ;setting focus based on control value (1 Viewer)

alcifer_c

Registered User.
Local time
Today, 15:30
Joined
Jun 3, 2002
Messages
42
Help with this is much appreciated as I have been working on it for hours!
What I want to do:
I have set up a form with 4 different tabs. Using the value of a control within the form, I wish to change which page
of the tab control displays the information. Each tab displays different information for various product
categories. When refering back to the record, I would like to use the same form, however automatically have the
focus set to the product category that applies.
From what I've looked into, the following should work, but nothing happens, no error message, no change in
focus. (Below is tied into the on load property) Once I get it working, I will be able to "fill in" for all product
types/tabs...

If Forms![view created ticket]![product type] = _
"cola" Then
TabCtl0 = 2
Else
TabCtl0 = 0
End If

I found my info from the following pages:
http://www.microsoft.com/accessdev/articles/bapp97/chapters/ba03_7.htm#5ReferringtoandChangingtheCurrentPage
 
R

Rich

Guest
If Me.prodType = "cola" Then
Page1.SetFocus
Else
Page2.SetFocus
End If

where prodType is the re-named control [product type]
use the property sheet to get the page numbers.
 

alcifer_c

Registered User.
Local time
Today, 15:30
Joined
Jun 3, 2002
Messages
42
So simple, works like a charm. I don't know why the command you specify was not easier to find. Thanks again, Al
 

Users who are viewing this thread

Top Bottom