A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with an expression to calculate a profit from one of three fi



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old May 29th, 2010, 11:42 PM posted to microsoft.public.access.forms
Jen
external usenet poster
 
Posts: 544
Default Help with an expression to calculate a profit from one of three fi

Using Access 2003 SP3 - in Forms

I know I'm probably asking a very complex question, so a very big THANK YOU
to whomever can help.

I am doing a detailed inventory and need help with an expression in my form
that will calculate my profit based on one of three fields. Only one field
would have the end data.

To clarify what I am working with: Most stock items come by the "unit" and
contain multiple "subunits" which, in turn, contain smaller "pieces."
However, some "units" only come with "subunits" and some only come as "units."

Here is what I have done so far, along with the (format) and followed by the
expression.

Unit Cost (currency) ~ CS:Unit Cost
Units on hand (number) ~ CS:Units on hand
Cost of all Units on hand (currency) ~ =Nz([UnitCost],0)*Nz([UnitsOnHand],0)
Number of Subunits per Unit (number) ~ CS:Number of Subunits per Unit
Subunit Cost (currency) ~
=IIf([NumbSubUnitsPerUnit]=0,Null,Nz([UnitCost])/Nz([NumbSubUnitsPerUnit]))
Subunits on hand (number) ~ CS:Subunits on hand
Cost of all Subunits on hand (currency)
~ =Nz([SubUnitCost])*Nz([SubUnitsOnHand])
Number of Pieces per Subunit (number) ~ CS:Number of Pieces per Subunit
Piece Cost (currency) ~
=IIf([NumbPiecesPerSubUnit]=0,Null,Nz([SubUnitCost])/Nz([NumbPiecesPerSubUnit]))
Pieces on hand (number) ~ CS:Pieces on hand
Cost of all Pieces on hand(currency) ~ =Nz([PieceCost])*Nz([PiecesOnHand])
Total Cost of All on Hand (currency) ~
=Nz([CostUnitsOnHand])+Nz([CostSubUnitsOnHand])+Nz([CostPiecesOnHand])
Selling At (currency) ~ CS:Sell At

Profit (currency) ~ =[SellingAt]-[??cost on hand??]**

**Here is where I need the help. I need an expression that will calculate
the profit based on whichever of the following fields contain the final "cost
on hand" data:

Cost of all Units on hand , Cost of all Subunits on hand , or Cost of all
Pieces on hand

Typically the final cost on hand data will be in "Cost of all Pieces on
hand", but occasionally it will be in one of the other two. Is there an
expression that I can use that will find the last of the three calculated
data fields and use that data?

If there isn't, how would I go about creating a combo box list that would
include only the calculated data in those fields for only the current record?
And if this is possible, could I then use the value displayed in the combo
box to figure the profit?

Again, Thanks ahead of time.
J
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.