fomatting vol wgt in kgs from cm or inches

  • Thread starter Thread starter fishqqq
  • Start date Start date
F

fishqqq

I have a form which wil calculate the volume weight of a shipment from
cm or inches depending on what the user inputs.

i'm having difficulty figuring out how to automatically determine what
formula the field should base it's result from.

if[Combo229 = "cm" then [text224]=(([Lock L]*[Lock W]*[Lock H])*[Lock
QTY])/6000

"this calculates vol wgt when the user inputs the dims in cm's"

if [combo229] = "inches" then [text224]= (([Lock L]*[Lock W]*[Lock H])/
366

"this calcuates the vol wgt when the user inputs the dims in inches"

I'm certain my formatting is incorrect but i don't know where.

any help is greatly appreciated.

thanks
Steve
 
I have a form which wil calculate the volume weight of a shipment from
cm or inches depending on what the user inputs.

i'm having difficulty figuring out how to automatically determine what
formula the field should base it's result from.

if[Combo229 = "cm" then [text224]=(([Lock L]*[Lock W]*[Lock H])*[Lock
QTY])/6000

"this calculates vol wgt when the user inputs the dims in cm's"

if [combo229] = "inches" then [text224]= (([Lock L]*[Lock W]*[Lock H])/
366

"this calcuates the vol wgt when the user inputs the dims in inches"

I'm certain my formatting is incorrect but i don't know where.

any help is greatly appreciated.

thanks
Steve

A couple of ways to do this; if it's just for display - as it should be! -
then you can set the Control Source of [text224] (though I'd REALLY REALLY
recommend you rename this control to something meaningful!!!) to

= ([Lock L]*[Lock W]*[Lock H])*[Lock QTY]) / IIF([Combo229] = "CM", 6000, 336)

This assumes that the combo has only two possible values; if it might be
cubits or microns or... then you'll need a more complex expression.

Note that if any of the three arguments is NULL the entire result will be
NULL. You may want to use the NZ() function to return some valid value, if
such a value is defined.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
I have a form which wil calculate the volume weight of a shipment from
cm or inches depending on what the user inputs.
i'm having difficulty figuring out how to automatically determine what
formula the field should base it's result from.
if[Combo229 = "cm" then [text224]=(([Lock L]*[Lock W]*[Lock H])*[Lock
QTY])/6000
"this calculates vol wgt when the user inputs the dims in cm's"
if [combo229] = "inches" then [text224]= (([Lock L]*[Lock W]*[Lock H])/
366
"this calcuates the vol wgt when the user inputs the dims in inches"
I'm certain my formatting is incorrect but i don't know where.
any help is greatly appreciated.
thanks
Steve

A couple of ways to do this; if it's just for display - as it should be! -
then you can set the Control Source of [text224] (though I'd REALLY REALLY
recommend you rename this control to something meaningful!!!) to

= ([Lock L]*[Lock W]*[Lock H])*[Lock QTY]) / IIF([Combo229] = "CM", 6000, 336)

This assumes that the combo has only two possible values; if it might be
cubits or microns or... then you'll need a more complex expression.

Note that if any of the three arguments is NULL the entire result will be
NULL. You may want to use the NZ() function to return some valid value, if
such a value is defined.
--

             John W. Vinson [MVP]
 Microsoft's replacements for these newsgroups:
 http://social.msdn.microsoft.com/Forums/en-US/accessdev/
 http://social.answers.microsoft.com/Forums/en-US/addbuz/
 and see alsohttp://www.utteraccess.com

that worked very well, thanks again John
 
Back
Top