default parameter value

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

How to set a default parameter value in the defination of a sub

for example :

sub outputreport( reportname as string, Datatype as string = "" )

end sub
Clara

thank you so much for your help
 
I think what you're looking for is optional parameters, which carry default
values.

Sub OutputReport(Optional strReportName as String = "MyReport", _
Optional strDataType as String = "" )

End Sub

good luck!
 
sub outputreport( reportname as string, Datatype as string = "" )

Look up help on the Optional keyword

public sub OutputReport _
( ReportName As String, _
Optional DataType As String = "" _
)




Hope that helps


Tim F
 
Back
Top