If statement questions

Tawcan

Registered User.
Local time
Today, 20:37
Joined
Mar 19, 2003
Messages
58
Hi,

Right now I'm trying to pull values out of an existing table then do some calculations. The thing is, not every cell in this particular column has a value, furthermore, I only want numerical values.

Before I had this kind of if statement but I don't think it works

If tb("GRADES") <> " P" Then
....

How would I code this? Thanx!

I probably can use IsNull("GRADES") but is there other options?
 
This topic has been covered endlessly in other posts. Search the forum on the keyword "null". Also check Access help on the words "null" and "nz". This article will probably also be useful.

Always search the forum before starting a new thread. 99.999 percent of the time your question has already been asked and you'll find a post that will at least get you further along.

When you DO come up with a new problem, though, post away--the folks here are VERY helpful.

--Deja Mac
 
Ahhh sorry.

So I can use IsNull("GRADES")= FALSE to exclude the cells that don't have a value. But what about cells that contain either "F" or "P" ?

Do I just do something like tb("GRADES") <> "P" AND tb("GRADES")<> "F"

Or is there a function that will do that? Like searching for numerical values only.

Thanx! :)

Edit:
Reading Nz on Access help.... thinking.... :cool:
 
What version of Access are you using? Search Access help for the function IsNumber.

--Helpful Mac
 
I'm using ADO to create a recordset which orders the existing table by session. The problem I ran into before was when I tried to do calculation, sometimes I get a NULL error due to the fact some cells are missing values. Would this work?

Dim num as Integer

num= num + CInt(Nz(res("GRADES"))) * CInt(res("ACT CREDITS"))

Both GRADES and ACT CREDITS are String, that's why the type casting. :)
 
directormac said:
What version of Access are you using? Search Access help for the function IsNumber.

--Helpful Mac

Using Office XP, so Access 2002. IsNumber couldn't be found on the help. :(
 
Try IsNumeric, IsString, "number", "Numeric", and anything else you can think of. Also "between", depending on what your actual data is.

And search the forums.

--Hinting Mac
 
directormac said:
Try IsNumeric, IsString, "number", "Numeric", and anything else you can think of. Also "between", depending on what your actual data is.

And search the forums.

--Hinting Mac

Just came up to my mind.... the values in GRADES are all string... though they might be 90, or F.

Thinking & searching....:p
 

Users who are viewing this thread

Back
Top Bottom