Forms with tabs

S

setabery

I have a form containing a main form and three tabs. The tabs each
contain a sub-form. I would like to set it up so when a value in a
text box on the main form is answered "Yes" the tab will appear (that
is, it becomes visible) so data can be entered to the sub-form
 
G

Guest

You could start with the credentials form open.
Within this statement you can enter tabname.visible=false

Within the properties of the textbox on the main form you can use the
after update or on lost focus.
a statement like if me.textbox=yes then..
me.tabname.visible=true
me.tabname.activate

Harry
 
S

setabery

You could start with the credentials form open.
Within this statement you can enter tabname.visible=false

Within the properties of the textbox on the main form you can use the
after update or on lost focus.
a statement like if me.textbox=yes then..
me.tabname.visible=true
me.tabname.activate

Harry

Thanks for your prompt reply. Unfortunately I am still having
problems and cannot get it to work.

I am still getting a compile error (Method or data member not found)
and am not sure why.

This is the code I have inserted into the After Update property of the
textbox on the main form. The tab's Visible property is set to No.

Private Sub Parent_AfterUpdate()

If Me.Textbox = Y Then

Me.tabname.Visible = True
Me.tabname.activate

End If

End Sub

I think the problem is with the Activate property as the debugger
lands there but I don't know how to fix it.

I am using MS Access 2003 running under Windows XP.
 
G

Guest

Hello Setabery,

My response was a little bit too fast.
I have checked it and I did point you in de right direction but not the
right way.

please find below the code I have tested and for me it works fine. I also
use Off2003 and XP.

Private Sub Form_Open(Cancel As Integer)
Me.PageToHide.Visible = False

End Sub

Private Sub TEST_AfterUpdate()
If Me.TEST = "yes" Then
Me.PageToHide.Visible = True
Me.PageToHide.SetFocus
End If
End Sub

You could make a code to hide the tab-page again when it loses it focus. Or
connect the code to another page so that when that page gets the focus it
will hide the tab-page.

Good luck
Harry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top