I am working on a project using Excel VBA, where I have several data sets, each of which is filled with a number of βpatientsβ that have a number of parameters (for example, treatment, result, etc.). To deal with this, I intend to create a class called "patient" with properties such as treatment and outcome. Then create a class called "dataset" with the public property "patient". I created classes and I can create an instance of a dataset object. But how do I find an instance of a patient object or, ideally, an array of patient objects in a dataset object?
Dataset class module:
Private pNumber As Integer
Public Patient As Patient
Public Property Get Number() As Integer
Number = pNumber
End Property
Public Property Let Number(p As Integer)
pNumber = p
End Property
Patient Class Module:
Private pID As Integer
Private pTreatment As Boolean
Private pResponse As Single
Public Property Get ID() As Integer
ID = pID
End Property
Public Property Let ID(p As Integer)
pID = p
End Property
Public Property Get Treatment() As Boolean
Treatment = pTreatment
End Property
Public Property Let Treatment(p As Boolean)
pTreatment = p
End Property
Public Property Get Response() As Single
Response = pResponse
End Property
Public Property Let Response(p As Single)
pResponse = p
End Property
The main module
Sub main()
Dim data1 As Dataset
Set data1 = New Dataset
'code to instantiate array of patient within data1 here
End Sub