Tag Property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • roycunderwood
    New Member
    • Feb 2008
    • 6

    Tag Property

    First off I wanted to Thank Everyone here for all your help!

    Second:

    How do I set the onclick Property Tag of a TextBox to = its Field.value? Example:

    Me!FirstMI.Tag = Me!FirstMI.Valu e?

    This Errors.
  • FishVal
    Recognized Expert Specialist
    • Jun 2007
    • 2656

    #2
    Hi, there.

    Tag is a String type property, while Value is Variant.
    VBA is not very type sensitive and often could silently make type conversion though its better to to make it explicitly. I guess that error raises when Value returns Null. You should use Nz() function to replace Null with "".

    Regards,
    Fish

    Comment

    • missinglinq
      Recognized Expert Specialist
      • Nov 2006
      • 3533

      #3
      You really need to post error messages when you have a problem. I, like Fish, suspect that a null value is giving you your problem, and can be addressed with Nz().

      You don't say wahat you're doing here, but you need to be aware that assigning the Tag property thru code like this only affects the Tag for the lifetime of the session. This Tag will disappear when the form is closed.


      Welcome to TheScripts!

      Linq ;0)>

      Comment

      • roycunderwood
        New Member
        • Feb 2008
        • 6

        #4
        I understand. Thank you! I was using it to store the value of a field for Audit Trail.

        Sample code:
        sql="Me!pwcuser & Changed Employee & Me!FirstMI & Me!LastName & Payrate FROM & Me!payrate.Tag & TO & Me!payrate.Valu e"

        It was a NULL value that was causing the problem. I added code to update all fields of the form on current event to copy the field value to the Tag value of the field for later comparison. But NULL was causing error.

        Will keep your ideas in mind in the future

        Comment

        Working...