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!

Trouble passing Greater or Less Than using a parameter query.

Status
Not open for further replies.

cashe

Technical User
May 4, 2002
60
0
0
GB
Hi All,

I'm trying to pass either Greater than 0 or Less than 0 to a query from a combobox on a form. It does not work because the query is looking for <0 as a value when it should be pulling up all negative numbers. The same is happening with >0.

My combobox has two values the user can select. >0, <0.

Does any one know how to over come this problem? All advice would be much apreciated.

Thanks

Cashe
 
Hi cashe,

try using an if...else block like:

if combobox = &quot;<0&quot; then
' add < 0 at the where clause
elseif combobox = &quot;>0&quot;
' add > 0 at the where clause
end if

regards,
nicsin
 
Hi Nicsin,

Thanks for your reply.

I'm using the query grid and there are 3 more queries which are dependent on this one. The query is not in the vba program so I can't use the if block. Is this true?

Thanks again

Cahse
 
Hi cashe,

No, but I think you can use the iif like:

iif(combobox=&quot;>0&quot;,>0,<0)

regards,
nicsin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top