"lorirobn" <lorirobn@yahoo.com> wrote in message
news:1117743977.279465.210960@g47g2000cwa.googlegr oups.com...[color=blue]
> Hi Justin,
> It has been awhile, but I am just now trying to change the style
> property from 'Tabs' to 'None', after exhausting all other options.
> Can you point me in a direction that explains steo by step how do do
> tab controls programmatically? I changed style from Tabs to None. I
> added a rectangle to Tab #1, and that got rid of the white background,
> and looks great. I made labels to replace the tops of my 6 tabs.
>
> Not sure what else to do now. What do I do with the controls on all my
> 6 tabs? How do I get the 'tabs' to work?
>
> Thanks,
> frustrated Microsoft user
> ps - does anyone out there use Access 2003 with win XP? are all YOUR
> tab controls white, or am I doing something wrong?[/color]
Imagine you have a tab control named ctlTab with two rectangles (your 'fake
tabs') named recTabOne and recTabTwo. In your code module you would have
the following:
' --Code Start
Private Sub SelectTab(TabNumber As Long)
On Error GoTo Err_Handler
Me.ctlTab.Value = TabNumber - 1
Exit_Handler:
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error No: " & Err.Number
Resume Exit_Handler
End Sub
Private Sub recTabOne_Click()
SelectTab 1
End Sub
Private Sub recTabTwo_Click()
SelectTab 2
End Sub
' --Code End
Note that while you are designing your form you could leave the style as
'Tabs' to enable you to select them easily - only switch the style to 'None'
when you have finished changing the layout. This makes it more convenient
to switch between tabs but you could also do this programatically when in
design view. Press ctrl-g to get the immediate window and type in, say,
Forms!MyForm.ctlTab.Value=1 which would select the second tab (the index is
zero-based).
As another possibilty is to have a look at
http://www.lebans.com where there
is code to customize the standard tab colours. However, I have not used
this myself.
HTH