PDA

View Full Version : Allow exceptions to maximum value.


ABC123

Annita Merriweather
01-06-2004, 07:30 AM
How do I allow the user to override a maximum value field rule? Thank you Annita

Tom Cone Jr
01-06-2004, 07:47 AM
Annita, I don't think you can. Isn't the purpose of the Maximum Value field rule to set an outside limit or boundary beyond which users aren't allowed to go?

Why do you want to specify a Maximum Value, and then sometimes let them go beyond it?

-- tom

Annita Merriweather
01-06-2004, 05:13 PM
Tom, there are always exceptions and occassionally the exception amount needs to be enter.
the other possibility is some type of warning system, that the amount is over the expected limit. With some sort of warning system, the amount can be reviewed and a decision made at that time. Thank you Annita

rtbtat
01-06-2004, 09:58 PM
Anita:

Tom gave you some good advice. If you set a maximum value for a field via the table's field rules, that means you cannot enter any amount that exceeds the max. value. Anita, that's how the field rule is designed to work.

However, there's almost always another way to do what you want. If you want to warn a user, advising them they exceeded a specified limit, that is very easy to accomplish.

You can change the color of the font if and when the value exceeds a certain number. For example, let's assume you are entering an order amount and let's arbitrarily state the maximum quantity for each customer order is 25.

You can create a font equation that changes the color of the font from black to RED if the order quantity exceeds 25. Now the user can enter a number greater than 25 for that customer, but the color of the font will change.

Remember, this is a font equation set on the form, it is not a field rule that one sets up in the table. If you create a field rule with a maximum value of 25 for the order quantity, the user cannot enter any value that exceeds 25.

Hope this helps,
Robert T.

Tom Cone Jr
01-07-2004, 02:12 AM
Annita,

If the 'maximum' amount you specify in the field rule isn't really a maximum in all cases you should look for a different solution. The field rule won't permit exceptions. Maximum is maximum I suppose.

I think the field rule is intended to catch data entry errors that are outside the range of 'legal' entries according to the business rules of your application. In an invoicing application you wouldn't normally want the invoice date to be later than 01/01/2100 or earlier than 01/01/1950 would you? If exceptions were permitted the user could enter an invoice date of 01/01/0001. See what I mean?

Robert's advice is good. Look for another way to check the entered value and do your own custom validation or warning for the user.

-- tom

Annita Merriweather
01-08-2004, 12:10 PM
Thank you. Annita

davej
01-09-2004, 07:25 PM
Annita,

I'll add another option, if I may.

Place an RTF object on the form, in close proximity to the field into which the value is entered. Set the visibility property of this object to hide and, using Robert's thought, change the field to show based on whatever value you wish. Obviously, you can include whatever text you want in the RTF field.

This won't preclude someone entering a value greated than your maximum value, but it will warn them that they are exceeding the desired max.

Dave