C
chuck
Which form event is triggered when moving to a new record or when closing
the form ? I'm actually looking for the event that is triggered when data
added to the controls are saved to the underlying table. I tried the "On
Current" event but that does not work.
This is actually a follow up to another message with subject "Detect if a
control is empty when moving to a new record or closing a form" sent on
16-DC at 10:04.
Essentially, I need to capture the complete error description when a 3314
error is encountered. If I don't do any error handling, there is a
predifined error message that come up when I move to a new record. The
error message includes the name of the underlying table's field name that is
empty:
Example:
"The field 'MyTable.MyField' cannot contain a Null value because the
Required property is set to true. Enter a value in this field."
I need to capture this complete error message somehow so that I can extract
the name of the field that is empty. I have not been able to figure out how
to do this. If I use the form's OnError event, all I can get is the error
number and the error description WITHOUT the field name:
Example of procedure for OnError event:
Private Sub Form_Error(DataErr As Integer, Response As Integer).
Error_Number = DataErr
Error_Message = AccessError(DataErr)
endsub
Error_Message returns: "The field '|' cannot contain a Null value because
the Required property is set to true. Enter a value in this field."
As you can see, the field name is missing.
How can I capture the complete error message including the field name in a
variable and using which event would I need to use ?
the form ? I'm actually looking for the event that is triggered when data
added to the controls are saved to the underlying table. I tried the "On
Current" event but that does not work.
This is actually a follow up to another message with subject "Detect if a
control is empty when moving to a new record or closing a form" sent on
16-DC at 10:04.
Essentially, I need to capture the complete error description when a 3314
error is encountered. If I don't do any error handling, there is a
predifined error message that come up when I move to a new record. The
error message includes the name of the underlying table's field name that is
empty:
Example:
"The field 'MyTable.MyField' cannot contain a Null value because the
Required property is set to true. Enter a value in this field."
I need to capture this complete error message somehow so that I can extract
the name of the field that is empty. I have not been able to figure out how
to do this. If I use the form's OnError event, all I can get is the error
number and the error description WITHOUT the field name:
Example of procedure for OnError event:
Private Sub Form_Error(DataErr As Integer, Response As Integer).
Error_Number = DataErr
Error_Message = AccessError(DataErr)
endsub
Error_Message returns: "The field '|' cannot contain a Null value because
the Required property is set to true. Enter a value in this field."
As you can see, the field name is missing.
How can I capture the complete error message including the field name in a
variable and using which event would I need to use ?