Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2007

Tip: Looking for answers? Try searching our database.

Passing Access.Form object to a class module variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sreedhar - 30 Jan 2007 14:59 GMT
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

Signature

Sreedhar

Baz - 30 Jan 2007 15:08 GMT
When the argument is an object you need to use Property Set rather than
Property Let.  You should be getting a compile error.

> Hi everybody,
>
[quoted text clipped - 26 lines]
>         .ResizeMe
>     End With
Sreedhar - 31 Jan 2007 02:53 GMT
Hi Baz,

> 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.
Signature

Sreedhar

Perry - 30 Jan 2007 20:32 GMT
What happens if you replace
>    Set cUI.aForm = Me
by
Set cUI.aForm = Me.form

Krgrds,
Perry

> Hi everybody,
>
[quoted text clipped - 26 lines]
>        .ResizeMe
>    End With
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.