Archive for June, 2008


OpenOffice Calc Show Error Message on wrong input.

This post continues to explore the Validity tool in OpenOffice. If you miss the first introduction read here. This time we going to experiment how to control user input if it is not a List. For example, how can we notify user when user enter a name where he suppose to enter a price, or tell the user wrong input when she enter a value less than a predefined minimum value.

Create an entry like shown in below picture and go to menu Data and select validity.

Open the Validity Dialog box

Under the criteria tab, we select the Decimal for Allow field. This means we only allows user to enter a decimal value. For the Data field, select the greater than or equal to. This is to make sure any value user enter must more or equal to the minimum value. In the Minimum field enter 1.00 just like that the picture below shows.

Set the input cell criteria

The next part, we going to setup what is the message we going to prompt the user if the input value does not satisfy the criteria we just set. Still in the validity dialog box, select the Error Alert tab. Make sure you checked the “Show error message when invalid values are entered. Also, make sure Action is set to Stop so that the error value is discarded. The title will set the title of the error prompt, for this example we use Invalid Price. Last step, enter your error message in the Error Message text area like the picture shown below.

Setup the error prompt

 

Now, lets try the first testing where we going to enter a phrase instead of valid price value. Enter the name Hen Som under the name cell, and enter the value “Where got”, and enter. You will get the error message prompt like picture below:

test1

In the second test case, we going to input a valid price value but the value is smaller than the minimum value we just set - 1.00. Again you will get the same error prompt.

test2

For the last test, we going to enter a valid value that is more than 1.00. And the data entry will be, of course, successful.

successful entry