can you filter a tab embedded subform by tab name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a tab control set up in Access 2003 with an embedded subform linked to
a table. I need to filter the subform to pull back only the record that
relates to the tab (by tab name?)

ie. a picture shows a top, skirt & hat with table references id1, id2 & id3
respectively so I have a tab control with 3 tabs names 'top, skirt & hat' and
a subform on each. When a user selects the 'skirt' tab the subform (single
form view) only pulls back the record for id2.

Any ideas?
 
Hi,

Have look at the following which references the page name, it may be of use
to you when modified for your needs.

Regards
Terry

' Control whether the nav buttons are available
Dim ctl As Control, tbc As Control, pge As Page

' Return reference to tab control.
Set tbc = Me.TabCtlForm
' Return reference to currently selected page.
Set pge = tbc.Pages(tbc.Value)

Select Case pge.Name
Case "pgeInvoicingProfile"
Me.cmdFirst.Enabled = True
Me.cmdNext.Enabled = True
Me.cmdPrevious.Enabled = True
Me.cmdLast.Enabled = True
Case "pgeProforma"
Me.cmdFirst.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrevious.Enabled = False
Me.cmdLast.Enabled = False
Case "pgeInvoiceHistory"
Me.cmdFirst.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrevious.Enabled = False
Me.cmdLast.Enabled = False
Case Else
Me.cmdFirst.Enabled = False
Me.cmdNext.Enabled = False
Me.cmdPrevious.Enabled = False
Me.cmdLast.Enabled = False
End Select
 

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

Back
Top