We help IT Professionals succeed at work.

VB.net manipulating a class from a standard module

Murray Brown
Murray Brown used Ask the Experts™
on
What VB.net code would be used in a standard module to add an item using the "Set" below

Public Class Class1


    Private _pJoinTables As String

    Property JointTables() As String
        Get
            Return _pJoinTables
        End Get
        Set(ByVal sValue As String)
            If (Not _pJoinTables.Contains(sValue)) Then
                _pJoinTables = _pJoinTables & "," & sValue 'Error on this line first &
            End If
        End Set
    End Property

End Class
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
here is complete code:-

Module Module1

    Sub Main()
        Dim objCls As New Class1

        objCls.JointTables = "Tab1"
        objCls.JointTables = "Tab2"
        objCls.JointTables = "Tab3"
        objCls.JointTables = "Tab2"


    End Sub

End Module

Public Class Class1


    Private _pJoinTables As String

    Public Sub New()
        _pJoinTables = ""
    End Sub

    Property JointTables() As String
        Get
            Return _pJoinTables
        End Get
        Set(ByVal sValue As String)
            If (Not _pJoinTables.Contains(sValue)) Then
                _pJoinTables = _pJoinTables & "," & sValue 'Error on this line first &
            End If
        End Set
    End Property

End Class

Open in new window

Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Thanks
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented: