Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2002
    Posts
    108

    Unanswered: Is it possible to change the tag property of a control through code ?

    I use the tag properties for various things and want to know if there is a way to change the tag property via code.

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    I've tried and never been able to. I hope someone will show us how!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Nov 2004
    Location
    Norway
    Posts
    441
    I think you would need to open the form in design view, to alter such properties.

    dim frm as form
    docmd.openform "myform", acdesign
    set frm = forms("myform")
    frm.controls("txtMyControl").Tag = "Just testing"
    docmd.close acform, frm.name, acsaveyes
    set frm = nothing
    Roy-Vidar

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    And of course, you can't do that from the form the tag resides in; to change a tag for a control in Form A, Form A has to be closed. So you'd have to

    Close Form A
    Open another form
    Change the tag with Roy-Vidar's code (which does work, BTW)
    Then re-open your form

    A lot of work for a simple change! But The ways of Access are often dark, but never pleasant! I'll stash your code away! Can't ever tell when I might need it! Don't even remember now why I wanted to change the tag thru code!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    how about a table: tblFakeTag which holds the control name (or even some unique real 'tag') and some other field that holds whatever you wanted in the 'tag' at a given moment.

    ugly alternative:
    have multi-tag 'tag' with some improbable separator between different 'tags' (e.g. '¦') and and then split() and then...

    izy

    AFTERTHOUGHT: wanting to modify tag suggests a 'modal' application - these are ugly anyway: find another solution.
    Last edited by izyrider; 01-14-07 at 15:32.
    currently using SS 2008R2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •