C
Cascot
I'm going around in circles here, and any help would be much
appreciated.
I have a form with several controls (comboboxes and textboxes) aimed at
gathering information for a sales order. There is a subform with
buttons above it for adding, editing and deleting sales items from the
order. Here are the problems I'm having...
1. If I have the subform enabled, tabbing through the controls (or
clicking the mouse into the subform if I set "TabStop = No" for the
subform) equates to moving off the record. I get errors raised at that
point if the record has been dirtied but every required field does not
yet contain data. So I disable the Subform until all required fields
contain data.
This just doesn't feel like a great approach, of course neither does
removing database level validation in tems of setting fields as being
required.
2. OK, so now the form behaves acceptably, enter the wonderful "Escape"
key. On many other forms I have thus far designed for the system, I use
the Form_Error procedure to capture error 2107 (The value you entered
entered doesn't meet the validation rule defined for the field or
control) and error 3314 (Entry required in this field, cannot contain
a Null value). Apparently the standard is that if you have typed over a
valid entry with invalid data you can restore the previous value by
pressing the escape key. This worked on my other forms, but on the form
I describe at the opening, pressing the escape key always closes the
form instantly, no matter what. As you can imagine this is very, VERY
far from perfect.
Can anyone shed any light on use of the Escape key, why it works on
other forms in terms of returning controls to their previous values,
yet on this form it always closes the form? I know I can catch any use
of the escape key and prevent form closure, but what I really want is
it to work the same way it does on my other forms, namely restoring the
original value of a control.
Any suggestions what I am missing here, or what I'm doing completely
incorrectly?
appreciated.
I have a form with several controls (comboboxes and textboxes) aimed at
gathering information for a sales order. There is a subform with
buttons above it for adding, editing and deleting sales items from the
order. Here are the problems I'm having...
1. If I have the subform enabled, tabbing through the controls (or
clicking the mouse into the subform if I set "TabStop = No" for the
subform) equates to moving off the record. I get errors raised at that
point if the record has been dirtied but every required field does not
yet contain data. So I disable the Subform until all required fields
contain data.
This just doesn't feel like a great approach, of course neither does
removing database level validation in tems of setting fields as being
required.
2. OK, so now the form behaves acceptably, enter the wonderful "Escape"
key. On many other forms I have thus far designed for the system, I use
the Form_Error procedure to capture error 2107 (The value you entered
entered doesn't meet the validation rule defined for the field or
control) and error 3314 (Entry required in this field, cannot contain
a Null value). Apparently the standard is that if you have typed over a
valid entry with invalid data you can restore the previous value by
pressing the escape key. This worked on my other forms, but on the form
I describe at the opening, pressing the escape key always closes the
form instantly, no matter what. As you can imagine this is very, VERY
far from perfect.
Can anyone shed any light on use of the Escape key, why it works on
other forms in terms of returning controls to their previous values,
yet on this form it always closes the form? I know I can catch any use
of the escape key and prevent form closure, but what I really want is
it to work the same way it does on my other forms, namely restoring the
original value of a control.
Any suggestions what I am missing here, or what I'm doing completely
incorrectly?