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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering

Status
Not open for further replies.

ITheadache

IS-IT--Management
Jun 13, 2006
45
US
Ok, last question I believe, and then this project should be done.

I am trying to filter my records. Some of the records contain numbers, and others are null. The code I tried is

Me.OrderByOn = False
Me.OrderBy = "Invoice #"
Me.OrderByOn = True
Me.FilterOn = False
Me.Filter = "[PFO2008] <> '0' or [PFO2008] = """
Me.FilterOn = True

But this gives me a runtime error, stating that this is an improper use of null.

Thanks,

Bryan
 
Try OR ISNULL([PFO2008]) instead of or [PFO2008] = """
(IsEmpty only checks to see if a variable has been initialized)
Good Luck!

I have great faith in fools; self-confidence my friends call it.
-Poe
 
I tried

Me.OrderByOn = False
Me.OrderBy = [Invoice #]
Me.OrderByOn = True
Me.FilterOn = False
Me.Filter = "[PFO2008] <> '0' OR ISNULL([PFO2008])"
Me.FilterOn = True

And now it keeps asking for paramater values, and the records are no longer in the order of the invoices. Have no idea what just happened
 
Basically, I am just tring to find a way to display only the records that do not have 0 in the field. Any help would be appreciated.
 
you could try


where fieldname <> 0

or

where ((fieldname < 0 ) OR (fieldname > 0 ))



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top