Hi,
I am trying to better understand the class modules in Access vba. I created my first class and I am getting a variable not set error and I can not figure out what is the problem
Any guidance will be greatly appreciate.
I am trying to better understand the class modules in Access vba. I created my first class and I am getting a variable not set error and I can not figure out what is the problem
Any guidance will be greatly appreciate.
Code:
' the class module has the following code'
Option Compare Database
Option Explicit
Private oForm As Form
Private ControlCollection As VBA.Collection
Public Property Set p_Form(vNewValue As Form)
Set oForm = vNewValue
End Property
Public Property Get p_Form() As Form
Set p_Form = oForm
End Property
'I am calling the code from a click bottom on the form'
Option Compare Database
Option Explicit
Private NewFrm As Cls_Form
Private Sub btnTest_Click()
Set NewFrm = New Cls_Form
Set NewFrm.p_Form = Me
End Sub