Results 1 to 9 of 9
  1. #1
    tstoneami is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    71

    Is there a way to individually reference a Tag? Please help!

    I guess I can't figure this one out. I can see how to iterate over all the controls to find the Tag collection, then do something with it.



    Problem is that since I know the name of the tag, I just want to do something with it (height, visibility, etc). But I can't figure out how to reference a tag directly without iterating over all the controls.

    Something like me.tag("tagname").height=0

    God I am going nuts with this.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    One of us is confused, because the tag property isn't something visible to the user as far as I know.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    tstoneami is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    71
    I grouped controls in a tag name. I want to reference that tag name like you would a text field field, to set it's visibility, etc.

    Like, I have a whole sections of a report I would like to make not visible based on user choices before they are run - for example.

    Haha! Yep, confused am I.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Don't think either can reference tag directly. It is property of control and it is the control property you want to set. The tag value can be used as criteria whether or not action should occur.

    There are ways to restrict the controls that are included in iteration.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Well, I haven't worked with 2010 extensively, but the only "tag" I'm aware of is a property of an individual control. You don't mean a tab control, do you? Or can you post a picture of what you're describing?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    tstoneami is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    71
    http://blogs.office.com/b/microsoft-...-property.aspx

    In this blog its described how you can group controls into a tag name, iterate over all the controls, and when you hit the controls with a certain tag perform an action.

    My problem is that I can't see a way to iterate individual tags, only iterating over all of them as a whole. I can't see a way around doing this multiple times in my application.

    Because I already know what tags(collections) I need to perform which specific action to, I'd like to just reference them directly.

    Hope this makes better sense. Right now I am being forced to individually address lines in a report in format VBA - very tedious. If I could affect the tagged group as a whiole it would be much better.

  7. #7
    tstoneami is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    71
    http://blogs.office.com/b/microsoft-...-property.aspx

    In this blog its described how you can group controls into a tag name, iterate over all the controls, and when you hit the controls with a certain tag perform an action.

    My problem is that I can't see a way to iterate individual tags, only iterating over all of them as a whole. I can't see a way around doing this multiple times in my application.

    Because I already know what tags(collections) I need to perform which specific action to, I'd like to just reference them directly.

    Hope this makes better sense.

    I have been successful using this method looking for instr() and field lengths. But again I only know how to iterate them.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Never used tag property. If I need to manage control properties (Visible, Enabled, BackStyle, etc) with VBA, I usually just reference each control specifically in code. In several cases I gave controls similar names with an incrementing suffix then I reference those controls in a loop by constructing their name with a variable.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I've used it, as it can be handy to affect a group of controls, but to my knowledge you have to iterate with the loop, testing for the desired tag value.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-16-2013, 01:34 PM
  2. Replies: 2
    Last Post: 01-11-2012, 06:06 PM
  3. Cross reference
    By Anne in forum Access
    Replies: 9
    Last Post: 09-23-2011, 08:01 AM
  4. need help with reference..
    By dada in forum Programming
    Replies: 3
    Last Post: 09-17-2010, 06:07 PM
  5. Replies: 0
    Last Post: 04-19-2008, 09:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums