By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,688 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,688 IT Pros & Developers. It's quick & easy.

Need check box to change formula used in subform source

P: n/a
I have a subform for listing parts. It has fields including: ClaimID, ITEM,
NET PRICE, LIST PRICE, Quantity, Supplier, and a calculated field called Part
Total. The subform is based on a query. The Part Total field is calculated
as (=[tblParts].[NET PRICE]*[tblPartPerClaim].[Quantity]). Then there is a
hidden text box on my subform that calculates the sum of all the Part Totals
for each claim. There is another field on my main form set equal to this
field on the subform.

My question is: Can I have a check box on my main form that, if checked,
would apply a formula to use the LIST PRICE in the calculation instead of the
NET PRICE?

I imagine that I would enter some sort of criteria statement under the
query's calculated fields.

I appreciate any help.

Thanks,

Shannan
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200508/1
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
use the IIF function. You're probably going to need Keri's article on
referring to controls etc from AccessWeb, which is here
http://www.mvps.org/access/forms/frm0031.htm

and then you'd do something ilke

TotalPrice=Quantity * (IIF(ParentForm.CheckBox=Checked,[ListPrice],[NetPrice]))

Of course, you're going to have to read Keri's article and get the
exact syntax down for referring ot the right control, but that should
do it.

Nov 13 '05 #2

P: n/a
Would this be entered in the criteria section of the query under the
PartTotal column or would you use VB to do this in the onopen event of the
subform control?

Thanks for your help,

Shannan

pi********@hotmail.com wrote:
use the IIF function. You're probably going to need Keri's article on
referring to controls etc from AccessWeb, which is here
http://www.mvps.org/access/forms/frm0031.htm

and then you'd do something ilke

TotalPrice=Quantity * (IIF(ParentForm.CheckBox=Checked,
[ListPrice],[NetPrice]))

Of course, you're going to have to read Keri's article and get the
exact syntax down for referring ot the right control, but that should
do it.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200509/1
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.