Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass directory to function 1

Status
Not open for further replies.

irishjoe

Programmer
Aug 5, 2002
76
AU
Is something along the lines of this available?
For this example, I want to be able to send the name of the form into a function, so I can modify things on it.
In the end, I would like to re-use the function and send in various forms.

If anyone can assist, it would be greatly appreciated.

Code:
changeColour("Form_frmMainMenu")

Code:
Private Function changeColour(dir As String)
    dir.btnUndo.ForeColor = 255  
End Function
 
changeColour Me

Private Sub changeColour(frm As Form)
frm("btnUndo").ForeColor = 255
End Sub

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top