F
FatMan
Hi all:
I am getting an invalid use of null in the if statement below (in Access
2000) and do not usnderstand why. Can anyone help me?
Background:
- rs has been declared as a recordset
- rs!GrowerEmail is the email address for our grower/customer
- the code below is part of the code used to email a report to our
growers/customers and works find for those records where the email address is
not blank/null.
- when I put in a control stop and run the program in debug mode and step
through each line of code and hover my mouse of "rs!GrowerEmail" in the "If
rs!GrowerEmail = Null then" part of the IF statement my mouse pointer display
"rs!GrowerEmail = Null". As well the debug.print statement just before the
IF statement will print out the GrowerFarmName and for the strGrowerEmail
part of the statement that should print "*EmailAddress* only prints "**"
Why will not the If statement recognize that rs!GrowerEmail is null? Any
help is greatly appreciated.
Thanks,
FatMan
Code follows.........
Debug.Print "strGrowerFarmName = " & strGrowerFarmName & " " &
"strGrowerEmail = *" & rs!GrowerEmail & "*" & " " & Len(rs!GrowerEmail)
If rs!GrowerEmail = Null Then
rs!GrowerEmail = "No email address on file"
Else
strGrowerEmail = rs!GrowerEmail
End If
I am getting an invalid use of null in the if statement below (in Access
2000) and do not usnderstand why. Can anyone help me?
Background:
- rs has been declared as a recordset
- rs!GrowerEmail is the email address for our grower/customer
- the code below is part of the code used to email a report to our
growers/customers and works find for those records where the email address is
not blank/null.
- when I put in a control stop and run the program in debug mode and step
through each line of code and hover my mouse of "rs!GrowerEmail" in the "If
rs!GrowerEmail = Null then" part of the IF statement my mouse pointer display
"rs!GrowerEmail = Null". As well the debug.print statement just before the
IF statement will print out the GrowerFarmName and for the strGrowerEmail
part of the statement that should print "*EmailAddress* only prints "**"
Why will not the If statement recognize that rs!GrowerEmail is null? Any
help is greatly appreciated.
Thanks,
FatMan
Code follows.........
Debug.Print "strGrowerFarmName = " & strGrowerFarmName & " " &
"strGrowerEmail = *" & rs!GrowerEmail & "*" & " " & Len(rs!GrowerEmail)
If rs!GrowerEmail = Null Then
rs!GrowerEmail = "No email address on file"
Else
strGrowerEmail = rs!GrowerEmail
End If