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

What is Infinity called.....

Status
Not open for further replies.

soupisgood84

Technical User
Apr 17, 2007
45
US
Just a quick question that I couldn't Google; (evidently there is something called VBA Infinity, lol)

I am setting perimeters for a query and I would like to know how to set a -Infinity and +Infinity to a price.

Please help...thanks

Code:
Me!txtLowerPrice = -Infinity
Me!txtUpperPrice = Infinity
 




Hi soupisgood84,

Are you sure that your computer has enough internal memory? After all, infinity is a pretty big number, you know!

Seriously though, NaN, Infinity, and Divide by Zero are new VB.NET constants. Nothing here in VBA.

Skip,

[glasses] [red][/red]
[tongue]
 
Use a Null value for your form parameters and have criteria like this in your query:
WHERE ([price field]>=[Forms]![form name]![txtLowerPrice] OR [Forms]![form name]![txtLowerPrice] Is Null)
AND ([price field]<=[Forms]![form name]![txtUpperPrice] OR [Forms]![form name]![txtUpperPrice] Is Null)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
erm, why not just leave the perimeters out?

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top