Re: Redundency of IsNull(Trim(myvar)) ?
From: Andy (Andrzej7_at_hotmail.com)
Date: 05/20/04
- Next message: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: JC: "Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: Bob Butler: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 20 May 2004 13:02:50 -0700
I think
Trim(myVariable) where myVariable is NULL
will give you an error - Invalid use of Null or something
because you can not Trim NULL.
You can do:
Trim(myVariable & "") where myVariable is NULL
--- Andy
>-----Original Message-----
>Hi,
>
>I am wondering if the following two statements always
yield the same
>results:
>
>1) If IsNull(Trim(myVariable)) Then [...]
>
>2) If IsNull(myVariable) Then [...]
>
>Basically, if myVariable is Null, then won't Trim
(myVariable) also be Null?
>Are there any instances when I would want to leave the
Trim() function in
>the above statement?
>
>Also, are the answers to these questions dependent on
which VBA platform is
>used (i.e. VB6 vs. VBScript)?
>
>Thanks in advance!
>
>JC
>
>
>.
>
- Next message: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Previous message: Jeff Johnson [MVP: VB]: "Re: Redundency of IsNull(Trim(myvar)) ?"
- In reply to: JC: "Redundency of IsNull(Trim(myvar)) ?"
- Next in thread: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: songie D: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Reply: Bob Butler: "Re: Redundency of IsNull(Trim(myvar)) ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|