TAG - Is it possible to have more than one

prometro

Registered User.
Local time
Today, 13:18
Joined
Aug 29, 2006
Messages
55
Hi, is it possible to have more than one tag ("identification") for a textbox ?
Thank you
Jiri
 
You can't have more than one TAG, but you can store more than one piece of info and then get at it. It depends on what you are needing but I typically can use something like this:

TAG - Admin;AddEdit

So, then I check to see if Admin is in it:

If Instr(1, ctl.Tag, "Admin") > 0 Then


or if I need to use parts of it I can use the Split Function:

TAG: Something|C:\Temp\

So then for one operation I may want the second part and use

Code:
Dim varSplit As Variant

varSplit = Split(ctl.Tag, "|", , vbCompareText)

MyPath = varSplit(1)
 
Just to add to what Bob said, "It depends on what you are needing", choose your delimeters wisely if you're programatically changing the tag. If the tag is static then you need not worry.
 
additionally - I dont think I have ever used the tag (probably in common with many users) - so can you confirm what you are trying to do with the tag
 
Hi, thanks for your reactions!
In fact I need it to do this : check if a group of textboxes is full of data or not.
If not, the bordercolor will change. It works perfect for goup with tag "kontola" but
not working if i had in TAG line two words : kontrola;kontrola2

For Each ctl In Me.Controls
If ctl.Tag = "kontrola" Then
If IsNull(ctl.Value) Or (ctl.Value = 0) Then
ctl.BorderColor = "255"
Else
ctl.BorderColor = "12632256"
End If
End If
Next
 
With more than one value, you can't use "=" like that. I'd use InStr() as Bob demonstrated (though watch out; as your values are similar, testing for "kontrola" will find both).
 

Users who are viewing this thread

Back
Top Bottom