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

Chapter 8. Objects, Properties, Methods,... > Passing Objects to Subroutines and F...

Passing Objects to Subroutines and Functions

Just as you can pass a string or a number to a subroutine or function, you can also pass an object to a subroutine or function. The code, found in the basExamples module in the Chap8Ex database, looks like this:


Sub ChangeCaption(frmAny as Form)
    'Change the caption property of the form received
    'to what was already in the caption property,
    'concatenated with a colon and the name of the current user
    frmAny.Caption = frmAny.Caption & ": " & CurrentUser
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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