Link to home
Start Free TrialLog in
Avatar of dhemple
dhempleFlag for United States of America

asked on

MS Access code update that will allow identifation of blank or null values during import

Hello Experts.  I need your help to change the below Function code to also allow for null or blank values.  Currently the code updates chk1 to True when there is a date, but does not update chk1 to True when null or blank.


Function chk1(A As String) As Boolean
'Check date
Dim i As Integer, l As Integer, c As String
A = Trim(A) 'remove possible spaces
chk1 = False
If IsDate(A) Then chk1 = True
If IsNull(A) Then chk1 = True    'I inserted this line, but it does not work

End Function
ASKER CERTIFIED SOLUTION
Avatar of Jim Dettman (EE MVE)
Jim Dettman (EE MVE)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are you really intending to change the value of A in the calling procedure?

By default, arguments are passed by reference (ByRef) that means a pointer is passed rather than a copy of the variable.  So, your code when it changes A, is changing A in the calling procedure.
Avatar of dhemple

ASKER

Thank you for your assistance with this question.