RE: Code error is null

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have not tested this, but I think it will do the trick. I return 99 in the
Nz() function so that a Null value will translate to a value larger than you
are checking for.

ed = DLookup(strLookup, "qryCheckRecSent", crit)
If Nz(Me.Text503,99) < 1 And Me.ExAge >= 25 Then
ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent", crit)
End If

"dbl" wrote:

> Hi I have the following code which I need to work out how to tell it if
> Text503 is null then to ignore this part of the code
>
> If Me.ExAge >= 25 And Me.Text503 <1 Then
> ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent", crit)
> End If
>
> I have tried different ways but all produce the following error Compile
> Error Expected Expression
> this is what I have done, how do I put it right?
>
> ed = DLookup(strLookup, "qryCheckRecSent", crit)
> If Me.ExAge >= 25 And Me.Text503 Is Not Null And <1 Then
> ed = ed + DLookup("[Novice25Plus]", "qryCheckRecSent", crit)
> End If
>
> Any help would be very much appreciated.
>
> Bob
>
>
>
.



Relevant Pages

  • Re: Mr Pinball site 404 error
    ... A neat little trick to use is to use the google website lanuage ... site from German to English. ... Use the translate a web page at the ...
    (rec.games.pinball)
  • Re: VBScript to exe with Windows
    ... A trick here: http://www.mclaveau.com/grimoire/bleu.html#998 ... It's in french. ... so simple that it is useless to translate. ...
    (microsoft.public.scripting.vbscript)