Hi,
Is there any way to override a form variable that is being passed. Would it be
done via cfif?
....
Ok, that's a bit vague, so I'll try to clarify (I'm a little tired so bear
with me :confused;). I have the user fill out a form adding a new part to their
inventory. If there going to take some parts out of the new stock there putting
in to the database, it would leave a net amount (Gross amount being what was
originally going to be inserted). So, on the update page, would I put that cfif
statement in saying
<cfif #FORM.resNet# NEQ "">
<cfset #FORM.sOnHand# EQ #FORM.resNet#>
</cfif>
resNet being the resultant total of the previous calculation and sOnHand being
the previous amount (gross) that would have been inserted in the form if the
resNet field would have been left blank.
I [b]hope[/b] my point got across.
Thank you in advance!
Dan Bracuk - 27 Apr 2007 04:49 GMT
What happened when you tried the code you are asking about? By the way, in that specific piece of code, you don't need octothorps.
noobie2005 - 27 Apr 2007 13:38 GMT
Element RESNET is undefined in FORM.
Why don't I need octothorps?
Dan Bracuk - 27 Apr 2007 14:58 GMT
Are all your datatypes char or varchar?
noobie2005 - 27 Apr 2007 15:14 GMT
It's an access database, so...the sOnHand field is set to Number, if that's what you're asking
Dan Bracuk - 27 Apr 2007 16:48 GMT
Then get rid of the quotes around that value.
insuractive - 30 Apr 2007 19:53 GMT
a couple of (hopefully helpful) notes about your syntax:
<cfif #FORM.resNet# NEQ "">
<cfset #FORM.sOnHand# EQ #FORM.resNet#>
</cfif>
1) Dan's octothorp comment: If you are using a CF variable inside a <cfif> or
<cfset> tag, you don't need to use the # symbol. CF will evaluate those values.
2) The second line should be: <cfset FORM.sOnHand = FORM.resNet> (notice the =
sign)