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

Passing null values to variables

Status
Not open for further replies.

4321z

Programmer
Joined
Oct 21, 2003
Messages
45
Location
GB
I'm trying to pass values from fields within a form to a function shown below;

Function AllDataEnteredForTrade(blTradeSelected As Boolean, stTradePerson As String, dtWkStartDate As Date, intNumDays As Integer) As String
If blTradeSelected = True And Len(stTradePerson) > 0 And stTradePerson <> "None" Then
AllDataEnteredForTrade = "AllEntered"
End If
End Function

But when a field has a null value it can't be passed to the appropriate function variable, is there anyway around this?
 
Hi

Either make the parameter optional (in the function), or use NZ() to pass a default value

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top