I have a form with a subform made from a query. I this form I have a text box with the below code as its control source. The variable in this function is an expression from the sub-form query. However whenever there is no data produced from this query I receive a runtime error #2427 ‘you have entered an expression that has no value.’ I receive this error even when I substitute the conditional “If genvar = NULL “ or “If genvar = “” “ and I always receive the same error. Can anyone tell me how to get around this problem?
Function func(genvar)
If genvar Then
func = genvar
Else
func = 0
End If
End Function
Function func(genvar)
If genvar Then
func = genvar
Else
func = 0
End If
End Function