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

Dlookup fonction

Status
Not open for further replies.

fludan

Technical User
Feb 1, 2002
41
US
Hi
In my customer table I have set two fields to yes/no, gst and pst. In my product table I set the same field for taxes.
I have some clients who are taxable(because of location) and some products are not taxable.

In my form orders I inserted gst and pst from the customer table, in my subform I inserted the gst and pst from product table.
If a customer is taxable and the product is not I would like the taxes for the product to be 0.
Right now I am using this statement in my subform in producID After Update

Me![orderdetails.gstID] = (Forms![Orders].Form![customer.gstID]) - (DLookup("[gstID]", "[product]", "[productID]=Forms![orders]![ordersdetails subform].Form![ID]")) + (DLookup("[gstID]", "[product]", "[productID]=Forms![orders]![ordersdetails subform].Form![ID]"))
Me![orderdetails.pstID] = (Forms![Orders].Form![customer.pstID]) - (DLookup("[pstID]", "[product]", "[productID]=Forms![orders]![ordersdetails subform].Form![ID]")) + (DLookup("[pstID]", "[product]", "[productID]=Forms![orders]![ordersdetails subform].Form![ID]"))

But right now if the client is taxable and the product is not, it choses taxable.

Also with the above statement if the client is not taxable the product shows as not taxable and that's ok.
Can someone help me
Thanks
Frank
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top