For otptional parameter if you're not using Variant data type then you would need to specify the default value. The reason for that is because Integer has a default value of 0 (zero), so you can't check if it is missing. You can do something like this:
Code:Public Function MyFunction(Optional pParameter As Integer = -1) If pParameter = -1 Then 'No Value was passed 'Do something Else 'Do something else End If End Function




Reply With Quote