flc13090
New member
- Local time
- Today, 22:59
- Joined
- May 20, 2022
- Messages
- 2
Hello everyone,
I have created a custom function to test fields in a table via a QBE query.
But this function returns me #error if the validate field is empty or null
What should I do please?
Thanks
I have created a custom function to test fields in a table via a QBE query.
But this function returns me #error if the validate field is empty or null
What should I do please?
Thanks
Code:
Public Function myFunction(startdate As Date, _
validate As Variant, _
strfld1 As Boolean, _
strfld2 As Boolean, _
strfld3 As Boolean, _
strfld4 As Boolean, _
strfld5 As Boolean) As Long
Dim result$
If Not IsNull(startdate) And IsNull(validate) Then
result$ = 1
ElseIf conditions Then
statment
ElseIf conditions Then
statment
ElseIf conditions Then
statment
ElseIf conditions Then
statment
...
ElseIf conditions Then
statment
ElseIf conditions Then
statment
Else
result$ = 0
End If
myFunction = result$
End Function