473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Need check box to change formula used in subform source

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
2 1696
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: CSDunn | last post by:
Hello, I need some assistance with error handling in an Access 2003 Project form. The project is has a data source connection to a SQL Server 2000 database. The main form is named...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
0
by: Shannan Casteel via AccessMonster.com | last post by:
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. ...
3
by: Shannan Casteel via AccessMonster.com | last post by:
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...
2
by: Shannan Casteel via AccessMonster.com | last post by:
I have a simple invoice form with a subform that allows the user to list part numbers along with the quantity. The subform has a calculated field called that should take either the or the and...
1
by: Gt394 | last post by:
I have the following table and fields: tbl_Product ProductID Pkey Thickness NumbInPack tbl_QuoteDetails: QuoteNo fkey fkeyProductID fkey
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
1
by: ebernedo | last post by:
Hey guys, I have two main questions First off (pictures are kind of blurry) I have this table http://i197.photobucket.com/albums/aa109/ebernedo/DiscTable.jpg And thats my database I use my...
3
by: Simon van Beek | last post by:
Dear reader, How to change the RecordSource for a subReport. For forms the syntaxes is:
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.