R
rocco
Hello...
the subject can be a bit confusing, here is my doubt>
I have a form which instantiate a class. I would like that a control in the
form get the value of a property of the class. But this value can also be
Null. This is the code for the property:
----------------
Public Property Get IDtreatment(WhichID As String) As String
Dim rstTreatment As DAO.Recordset
Set rstTreatment = CurrentDb.OpenRecordset("SELECT TX FROM TBLREGVISITS
WHERE ID='" & WhichID & "' AND VISIT='V1'")
If rstTreatment.BOF = False Then
IDtreatment = rstTreatment.Fields(0)
Else
IDtreatment = Null
End If
End Property
----------------
But it fires me an error so I guess since the property is a string it cannot
be Null, at least it can be Empty, acting like a variable, but maybe not
null. Is this right (hoping it is clear first...)?
Rocco
the subject can be a bit confusing, here is my doubt>
I have a form which instantiate a class. I would like that a control in the
form get the value of a property of the class. But this value can also be
Null. This is the code for the property:
----------------
Public Property Get IDtreatment(WhichID As String) As String
Dim rstTreatment As DAO.Recordset
Set rstTreatment = CurrentDb.OpenRecordset("SELECT TX FROM TBLREGVISITS
WHERE ID='" & WhichID & "' AND VISIT='V1'")
If rstTreatment.BOF = False Then
IDtreatment = rstTreatment.Fields(0)
Else
IDtreatment = Null
End If
End Property
----------------
But it fires me an error so I guess since the property is a string it cannot
be Null, at least it can be Empty, acting like a variable, but maybe not
null. Is this right (hoping it is clear first...)?
Rocco