Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

isnull not wokring on second check

Status
Not open for further replies.

tania20

Programmer
Oct 30, 2006
148
0
0
AU
Hi, I have the following code. The weird thing is that if both the fields are null or not null then the code works fine but if one or the other is null then i get a type mismatch error. I have no idea whats causing this!!!

Code:
                       If IsNull(rs![Price_B]) Then

                        Else
                            rs![Price_B] = Format(IIf((rs![Price_B] > 0), (rs![Price_B] / 100 + 1), (100 / (rs![Price_B] * -1)) + 1), "#0.00")

                        End If

                        If IsNull(rs![Price_H]) Then

                        Else
                            rs![Price_H] = Format(IIf((rs![Price_H] > 0), (rs![Price_H] / 100 + 1), (100 / (rs![Price_H] * -1)) + 1), "#0.00")
                        End If [Code/]
 
What about using [!]Val([/!]Format(...)[!])[/!]

Or simply the Round function instead of Format ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top