M
Mister John Doe
I have a situation that has stymied me. Can anyone help?
I have a text box on a form. The text box name is Pages.
The Pages text box is being used to enter the number of pages that a
document has.
I have code checking for typical errors such as the following:
* non-numeric (such as XYZ or maybe the document title)
* NULL (nothing is entered at all)
* empty string (if the user enters something and then deletes it)
* Zero or less (a real document can't have zero pages or a negative
number)
So I display an error message to alert the user about any of these
conditions. So far all this works OK.
I have a lot of fields on the form, so I would like to set the
Conditional Formatting of each field to show when the field has one of
these error conditions.
I set the following Conditional Formatting for this Pages field:
Default formatting
For a required field the background color is a light blue. For a field
that is not required the background is white. In this case the Pages
field is required, so the default condition is set for having the
background color as light blue.
Condition 1
Field has focus: Set the background color to a light green.
Condition 2 (This is the one that doesn't work)
Here I want to have the Pages field display a background color of red
if the value entered into the field is zero or is a negative number. I
entered the following:
Field Value Is - Less Than Or Equal To - 0
And I set the background color to be red.
When I enter the value of zero the Pages field turns red (when I move
to another field). So this part shows that it works correctly for
entries of the number zero.
However, when I enter a negative number such as -3 or -9 and then I
move to another field, nothing happens here in the Pages field. That
is, the Pages field background color is light blue. It should be red
but it's not.
I looked into the Table of Contents for the HELP and I also searched
MSDN but it appears to me that I am doing things the way it's
described in those documents. Obviously I am not, so I don't know what
is wrong.
You won't believe how much time I have spent trying to figure out this
really small thing. How frustrating. So any advice is appreciated.
I have a text box on a form. The text box name is Pages.
The Pages text box is being used to enter the number of pages that a
document has.
I have code checking for typical errors such as the following:
* non-numeric (such as XYZ or maybe the document title)
* NULL (nothing is entered at all)
* empty string (if the user enters something and then deletes it)
* Zero or less (a real document can't have zero pages or a negative
number)
So I display an error message to alert the user about any of these
conditions. So far all this works OK.
I have a lot of fields on the form, so I would like to set the
Conditional Formatting of each field to show when the field has one of
these error conditions.
I set the following Conditional Formatting for this Pages field:
Default formatting
For a required field the background color is a light blue. For a field
that is not required the background is white. In this case the Pages
field is required, so the default condition is set for having the
background color as light blue.
Condition 1
Field has focus: Set the background color to a light green.
Condition 2 (This is the one that doesn't work)
Here I want to have the Pages field display a background color of red
if the value entered into the field is zero or is a negative number. I
entered the following:
Field Value Is - Less Than Or Equal To - 0
And I set the background color to be red.
When I enter the value of zero the Pages field turns red (when I move
to another field). So this part shows that it works correctly for
entries of the number zero.
However, when I enter a negative number such as -3 or -9 and then I
move to another field, nothing happens here in the Pages field. That
is, the Pages field background color is light blue. It should be red
but it's not.
I looked into the Table of Contents for the HELP and I also searched
MSDN but it appears to me that I am doing things the way it's
described in those documents. Obviously I am not, so I don't know what
is wrong.
You won't believe how much time I have spent trying to figure out this
really small thing. How frustrating. So any advice is appreciated.