1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Ho to refer to a control on a page on tab control - MS Access

Discussion in 'Software Development' started by Chris_E, Mar 7, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    Hi all,

    Access 2003 with VBA code time again!

    I have a form named "MyForm" with a single tab control on it named "MyTabCtl1".

    The Tab Control holds three pages: "Tab_Page_1", "Tab_Page_2" and "Tab_Page_3" and each page has a number of bound controls on it.

    Now, on "Tab_Page_3" I have an unbound control called "Descriptor_00"

    I wish to create code that, on loading the form, will set the ".text" or ".value" property of "Descriptor_00" to be a combined string derived from other controls on the same and other pages.

    On a standard form, I'd use something like:

    Me!MyControl.Value = Me![First Control] & ", " & Me![Second Control] & (etc)

    to build my combined string.

    But, how would I do this for a control on a page of a tabbed control ? What's the syntax cuz I'me puzzled!!:confused:

    Does this make any sense?

    All the best

    Chris
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,895
    Chris, I know your problem, is the tabbed form a real form in it's own right, ie a subform. I have found that to be the best way around the problem.
     
  3. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    Hi OBP

    Well, the tabbed form sure is on a form, yes, so I guess its a subform in that respect, but I'm unused to thinking of it that way! There are no other controls on the form though. Only the Tabbed Control form.

    Am I missing the point? Sorry if I'm being a thicko!

    Chris
     
  4. cristobal03

    cristobal03

    Joined:
    Aug 5, 2005
    Messages:
    3,086
    ...

    Just be sure to think of every control on the main form strictly as a control. That is, a subform is actually a control on the main form. A page on a tab is a control on the main form. A control on a page on a tab is still a control on the main form. The only tricky referencing problem is referencing a control on a subform from the parent form, or vice versa.

    More info here and here.

    HTH

    chris.
     
  5. Chris_E

    Chris_E Thread Starter

    Joined:
    Feb 16, 2006
    Messages:
    360
    Thanks! All sorted now.

    Chris
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/448107

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice