This is my first time reaching out for help. I've tried searching but can't seem to find anything that matches my situation.
I have created 2 class modules: Match and MatchResultSet. MatchResultSet has the following properties and methods:
Public NoMatches As Integer
Public NoRounds As Integer
Private Matches() As Match
Public Function GetMatch(ByVal matchNumber As Integer) As Match
If matchNumber <= NoMatches Then
Set GetMatch = Matches(matchNumber)
Else
Set GetMatch = Nothing
End If
End Function
Public Sub SetMatch(ByRef aMatch As Match, ByVal matchNumber As Integer)
MsgBox ("A")
If matchNumber <= NoMatches Then
MsgBox ("B")
Matches(matchNumber) = aMatch
End If
End Sub
I tried to create a clone method for MatchResultSet that also needs to take a copy of the array of Match objects. However I get the error 438 "Object doesn't support this property or method" on the indicated line:
Public Function Clone() As MatchResultSet
Dim newMRS As MatchResultSet
Set newMRS = New MatchResultSet
newMRS.NoMatches = Me.NoMatches
newMRS.NoRounds = Me.NoRounds
For i = 1 To Me.NoMatches
Set newMatch = Me.GetMatch(i).Clone
Call newMRS.SetMatch((newMatch), i) '<=== error 438 here
Next i
Set Clone = newMRS
End Function
Can anyone help? From what I can tell, I'm calling the Sub with the same parameter class as I defined in my class module.