C
chuck
I have a form with several text box controls. One of the text boxes has its
Control Source set to a field that requires a value. I want to be able to
detect if the user has left the text box empty when moving to the next
record or when closing the form.
If I don't do any error handling, there is a predifined error message (error
3314) that come up and gives the name of the underlying table's field name
as being empty instead of the name of the text box used in the form :
Example:
"The field 'MyTable.MyField' cannot contain a Null value because the
Required property is set to true. Enter a value in this field."
Is there a way to replace that error message with something more helpful?
Ideally, I would also want to replace 'MyTable.MyField' with the name of the
text box instead of the table's field name.
I tried using the form's OnError event which uses the following procedure:
Private Sub Form_Error(DataErr As Integer, Response As Integer).
Unfortunately, I am only successful in capturing the error number. Can I
also get the name of the field ('MyTable.MyField' ) from which I could use a
"select case" statement to correlate the name of the field to the name of
the text box?
Thanks
Control Source set to a field that requires a value. I want to be able to
detect if the user has left the text box empty when moving to the next
record or when closing the form.
If I don't do any error handling, there is a predifined error message (error
3314) that come up and gives the name of the underlying table's field name
as being empty instead of the name of the text box used in the form :
Example:
"The field 'MyTable.MyField' cannot contain a Null value because the
Required property is set to true. Enter a value in this field."
Is there a way to replace that error message with something more helpful?
Ideally, I would also want to replace 'MyTable.MyField' with the name of the
text box instead of the table's field name.
I tried using the form's OnError event which uses the following procedure:
Private Sub Form_Error(DataErr As Integer, Response As Integer).
Unfortunately, I am only successful in capturing the error number. Can I
also get the name of the field ('MyTable.MyField' ) from which I could use a
"select case" statement to correlate the name of the field to the name of
the text box?
Thanks