Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Tab control showing entry

Discussion in 'Information Technology' started by SAC, Jul 28, 2006.

  1. SAC

    SAC
    Expand Collapse
    Guest

    I'd like to be able to someway indicate on a tab that a record has been
    entered in it's subform.

    Any ideas?

    Thanks.
     
  2. Loading...

    Similar Threads Forum Date
    As A Child, Public Marches Of Sikhism Made Me Uncomfortable. They Still Do . Why ? Whats The Logic Hard Talk Oct 16, 2016
    Windows 10-don't Click That Tab! Information Technology Aug 10, 2015
    World ISIS inside Syria's Tabqa military air base: activist Breaking News Aug 25, 2014
    Arts/Society Backyard Vegetable Garden Language, Arts & Culture Dec 27, 2013
    Heritage Now a Vegetable Market, Ranjit Singh's Royal Haveli a Picture of Neglect History of Sikhism Nov 11, 2013

  3. Allen Browne

    Allen Browne
    Expand Collapse
    Guest

    Unfortunately, Access does not permit you to apply different formatting to
    the Caption of each page in a tab control.

    Workarounds
    =========
    1. Use graphics
    Create a bitmap graphic of the 2 styles of text you want for each tab (e.g.
    bold and normal, or black and red). Then in the Current event of the main
    form, and the AfterInsert and AfterDelConfirm event of each subform, see if
    you need to swap the Picture property of the Page.

    2. Use an option group
    Set the Style of the tab control to None, so it displays no buttons.
    Add an Option group above the tab control.
    For each page of the tab control, add a Toggle button to the option group.
    In the AfterUpate event of the option group, set the Value of the tab
    control.
    The toggle buttons now contol the tab control, and you can format them.

    Set the OptionValue of the toggle buttons to start from 0 (not 1).
    Set the DefaultValue of the option group to 0 (so the first is initially
    selected.
    The AfterUpate event procedure or the option group will contain this line:
    Me.[YourTabControlNameHere] = Me.[YourOptionGroupNameHere]

    To determine if the subform contains any records, use:
    Me[NameOfYourSubformControlHere].Form.RecordsetClone.Count
    That works even if the subform displays no records (not even the new row.)
    It probably won't work in the main form's Current event, as the subforms
    won't be loaded yet. For that case you need to lookup the subform's table to
    see if there are any records. This kind of thing:
    Dim bHasRecords As Boolean
    Dim strWhere As String
    If Not Me.NewRecord Then
    strWhere = "[YourSubformsForeignKey] = " &
    Me.[YourMainFormsPrimaryKey]
    bHasRecords = Not IsNull(DLookup("ID", "MySubTable", strWhere))
    End If

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia.
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "SAC" <sac@somewhere.com> wrote in message
    news:uWGViN5gGHA.4892@TK2MSFTNGP02.phx.gbl...
    > I'd like to be able to someway indicate on a tab that a record has been
    > entered in it's subform.
    >
    > Any ideas?
    >
    > Thanks.
     

Share This Page