how set object using var?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jason7899
    New Member
    • Mar 2008
    • 59

    how set object using var?

    hi,
    i want to this using values from db i using vb6

    dim object_name

    set object_name = command1

    i want load the name "command1" from the db and do something
    like this:

    set object_name = value_from_db

    it this possible?
    thanks a lot for your help
    :)
  • Guido Geurs
    Recognized Expert Contributor
    • Oct 2009
    • 767

    #2
    dear,

    NAME is a read only property.
    So You can't change it during runtime.


    br,

    Comment

    • vb5prgrmr
      Recognized Expert Contributor
      • Oct 2009
      • 305

      #3
      Code:
      If Rs.Fields("ControlName").Value = "Command1" Then
        If Rs.Fields("PropertyName").Value = "Caption" Then
          Command1.Caption = Rs.Fields("PropertyValue").Value
        End If
      End If
      Is about the only way in which you can accomplish what you want to do as strings or string variables will not equate to an object or control property... i.e. Command1.strPro pertyName = strPropertyName



      Good Luck

      Comment

      Working...