Hello,
I started working on VBA,access from yesterday, and here I am with my first problem :). Please help.
I get the above mentioned problem when my UDF is returning an integer.(Follow ing is the UDF):
*************** *************** *************** *****
The argument passed to the UDF is a field which is either I or M or blank. The call to the UDF in the Where clause is:
(Missing([Missing data summary].Field40) = 1)
But I get data mismatch here. Is it beacause of the blank values in Field40,( which show an error in the retrieved table,if I run the query withouth this criteria in where clause). I get a 1 and 2 respectively corresponding to "M" or "I" in the Field40
Thank you!
I started working on VBA,access from yesterday, and here I am with my first problem :). Please help.
I get the above mentioned problem when my UDF is returning an integer.(Follow ing is the UDF):
*************** *************** *************** *****
Code:
Function Missing(a As String) As Integer Static count_mis As Integer On Error GoTo Err_Trap If a = "M" Then count_mis = 1 ElseIf a = "I" Then count_mis = 2 ElseIf IsNull(a) = True Then count_mis = 3 ElseIf IsEmpty(a) = True Then count_mis = 4 ElseIf IsError(a) = True Then count_mis = 5 Else count_mis = 6 End If Missing = count_mis Exit_Trap: Exit Function Err_Trap: MsgBox Err.Description Missing = 2 Resume Exit_Trap End Function ************************************************
(Missing([Missing data summary].Field40) = 1)
But I get data mismatch here. Is it beacause of the blank values in Field40,( which show an error in the retrieved table,if I run the query withouth this criteria in where clause). I get a 1 and 2 respectively corresponding to "M" or "I" in the Field40
Thank you!
Comment