Suntower
Posts: 225
|
| Posted: 10/06/2006, 1:01 PM |
|
I have a fairly typical order entry grid. There is only one entry control for each row. It is called ORDERQUANTITY.
There is a label on each row for MAXIMUMORDERQUANTITY which is pulled from a Product Master table. This displays properly, as do all the other labels on the row:
Product ID
Description
UnitPrice
UnitOfMeasure
What I want is, in the validation to have something like
IF FORM.ORDERQUANTITY.Value > FORM.MAXIMUMORDERQUANTITY.Value THEN
.AddErrors("Quantity exceeded!")
END IF
But this doesn't work. And the reason it doesn't work is because the only value in the row which returns a value is ORDERQUANTITY. IOW: If I enter:
response.write FORM.DESCRIPTION.Value & " " & FORM.ORDERQUANTITY.Value
response.end
...in the OnValidation event, the ORDERQUANTITY will display, but not the DESCRIPTION
Why?
Now... when I enter an 'action' to validate against a constant (ORDERQUANTITY > 30) this works fine.
So... How do I retrieve the value in each row for labels for use in Validation?
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
Suntower
Posts: 225
|
| Posted: 10/06/2006, 1:22 PM |
|
PS: If I change MAXIMUMORDERQUANTITY to an entry field the validation -does- work.
So it would seem that my guess was correct: Only -entry- type controls can be used for validation.
This is a drag. Is there no way to retrieve the value from row -label- controls?
---JC
_________________
---On a campaign for more examples and better docs! |
 |
 |
Benjamin Krajmalnik
|
| Posted: 10/06/2006, 8:31 PM |
|
Only way would be to code a lookup from the table, or the alternate method
which I sometimes use - place a hidden field.
You could also use custom SQL, creating the statement dynamically to use the
value already in the database in a computation.
More than 1 way to skin a cat, as they say.
"Suntower" <Suntower@forum.codecharge> wrote in message
news:64526baf625527@news.codecharge.com...
> PS: If I change MAXIMUMORDERQUANTITY to an entry field the
> validation -does-
> work.
>
> So it would seem that my guess was correct: Only -entry- type controls can
> be
> used for validation.
>
> This is a drag. Is there no way to retrieve the value from row -label-
> controls?
>
> ---JC
> _________________
> ---On a campaign for more examples and better docs!
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|