Simple Function Question

1. Senior Member
Join Date
Dec 1969
Posts
661

## Simple Function Question

Why does the &#060;%= NumberValue(bNumber) %&#062; show nothing below???<BR>Simple Function call ... yes?<BR><BR>Of course Here is bNumber = &#060;%= bNumber %&#062; shows : 566<BR><BR>&#060;%<BR><BR>Function NumberValue( rq ) <BR> If trim(rq) = "" Then <BR> NumberValue= "NULL" <BR> End If <BR>End Function <BR><BR>bNumber = 566<BR><BR> %&#062;<BR> <BR> Here is a record: &#060;%= NumberValue(bNumber) %&#062; <BR><BR> <BR><BR><BR> <BR> Here is bNumber = &#060;%= bNumber %&#062;<BR> <BR> <BR><BR>

2. Senior Member
Join Date
Dec 1969
Posts
273

## RE: Simple Function Question

Your function will only produce an output wher trim(rq) = "". You need to change it to produce an output when the number is valid...<BR><BR>Function NumberValue( rq ) <BR><BR>If trim(rq) = "" Then <BR>NumberValue = "NULL" <BR>Else<BR>NumberValue = rq<BR>End If<BR><BR>End Function <BR><BR><BR>Gavin

3. Senior Member
Join Date
Dec 1969
Posts
2,092

## Try

&#060;%<BR><BR>Function NumberValue( rq ) <BR>If trim(rq) = "" Then <BR>NumberValue= "NULL" <BR>End If <BR><BR>NumberValue = rq<BR><BR>End Function <BR><BR><BR>%&#062;<BR><BR>Function return things...<BR><BR>Hope this helps!<BR>Sincerely<BR><BR>Vlince

4. Senior Member
Join Date
Dec 1969
Posts
661

## thanks

...

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•