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.

Overloading function calls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TobiasPC - 24 Jan 2007 23:58 GMT
I have some custom vba module procedures and I wanted to make some of the
parameters optional (by setting a default value) so that I could use
different signatures.

I was wondering if anyone could help out with and example of how you do it,
if it is possible.

Thanks
John Nurick - 25 Jan 2007 06:46 GMT
Optional parameters are easy:

 Sub XXX(V As Long, _
   Optional Q As Long = 99, _
   Optional R As String = "Hello")

and you can even use named arguments if you like

 XXX V:=123, R:="Goodbye"

See Help for the Sub and Function statements and IsMissing() function
for more.

>I have some custom vba module procedures and I wanted to make some of the
>parameters optional (by setting a default value) so that I could use
[quoted text clipped - 4 lines]
>
>Thanks

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
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.