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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Returing objects from Sub Funtions

Status
Not open for further replies.

rpbenito

Programmer
Jun 13, 2001
63
US
How do I return a connection object from a sub function?
 
You can't return an object from a sub but you could dimension it as a module level variable and set it in the subroutine, or as already mentioned and probably the best.

Public Function GetConnection() As Connection
Dim Conn As Connection
' Set the connection values
Set GetConnection = Conn
End Function

Steve King Growth follows a healthy professional curiosity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top