how to look up value in query

confuse

Registered User.
Local time
Yesterday, 17:27
Joined
Jul 17, 2008
Messages
49
Hi can please do help..
Because i have form named purchase order with fields productid,product name,product sold,total. And i also have a query which will do the calculation of how many products are being sold.
The product id in purchase order form is combo box, if the user will choose which product id to purchase i want the product sold to display which will get value in the query. But need to test if product id = product id in product query if true then display the value of product sold if not display 0..

But i dont know where to put this test..

Thanks....:)
 
I apologize, but I am little confused in your set up ... however I will propose a solution to what I think is going on.

In your query, in the field row of a column, use something along the lines of ....

Code:
expProductSold: IIf(IsNull([ProductSold]),"0",[ProductSold])

In your form, that is based on this query, the form control will use expProductSold as a Control Source.

What is does is look at your calculated field (Product Sold). If it contains nothing (Null) then it will put a 0 in it.

-dK
 
I apologize, but I am little confused in your set up ... however I will propose a solution to what I think is going on.

In your query, in the field row of a column, use something along the lines of ....

Code:
expProductSold: IIf(IsNull([ProductSold]),"0",[ProductSold])

In your form, that is based on this query, the form control will use expProductSold as a Control Source.

What is does is look at your calculated field (Product Sold). If it contains nothing (Null) then it will put a 0 in it.

-dK

Please see attached file.

Thanks for the help
 

Attachments

Check the sample I have made some little ammendments in the code
 

Attachments

Users who are viewing this thread

Back
Top Bottom