Passing Access.Form object to a class module variable

S

Sreedhar

Hi everybody,

I have a class module as follows:

Private frm As Access.Form
-------------------------------

Public Property Get aForm() As Access.Form
Set aForm = frm
End Property
-------------------------------

Public Property Let aForm(NewForm As Access.Form)
Set frm = NewForm
End Property


Now, in a form's module, if I set the frm as under,
frm is not getting its value. Can someone please tell
me how to pass the Form object to the class module's
property object ?

-------------------------------
Dim cUI As clsUI
Set cUI = New clsUI

Set cUI.aForm = Me
With cUI
.FormPosition = posTitle
.ResizeMe
End With
 
B

Baz

When the argument is an object you need to use Property Set rather than
Property Let. You should be getting a compile error.
 
S

Sreedhar

Hi Baz,

Baz said:
When the argument is an object you need to use Property Set rather than
Property Let. You should be getting a compile error.

That's right. Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top