• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 10. The Real Scoop on Objects, P... > Passing Objects to Functions and Sub...

Passing Objects to Functions and Subroutines

One of the beauties of object variables is that you can easily pass them to a subroutine or function. They are always passed by reference, meaning that when you change the object's property in a routine, you're changing the property in the original example, too. As you will see, the ability to pass an object to a function or subroutine solves the problems created when building multiple instances of a form in the preceding example. The following code is found in CHAP10EX.MDB in the frmPassedToSub form and the basExamples module:

Private Sub cmdNewInstance_Click()
   Call NewInstance(Me)
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint