I have an indexed set of named properties, such as X1, X2, X3, etc, and I want to get the right one when I have 1, 2, or 3. I can easily create a string "X2" from that. So I need to do something like
me.properties("X2").value. But that doesn't work (it is returning 0, and not throwing an error). What is the right incantation here?
Solved! Go to Solution.
Here is an example:
Property X1 = "Audi"
Property X2 = GetValueFrom(Me, "X1")
In custom.vb have a function like:
public Function GetValueFrom(p as obj, prop as string) as string
Hope this helps and answers your question.
To all: It turns out me.Foo.Bar is equivalent to me.Foo.Properties("Bar").Value, which is what I thought and Thilak put into his function. The reason it wasn't working for me before was that I had a "bad foo". That is, the error was in the object being accessed (it was a connection).
Just to clarify - I don't think you can do this inside RS Architect
Me.Foo."Bar" (Since you have "Bar" as a string"). Of course this is valid Me.Foo.Bar.
All works fine for me.
Dim text_str As String = "The value of property " & Input_String & " is " & Me.Properties(Me.Input_String).Value msgbox(text_str)
Probably you need to verify your syntax, references, datatypes.