By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,960 Members | 1,235 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,960 IT Pros & Developers. It's quick & easy.

A97 - Can I trap 'n handle error #3315 inside my own error handler?

P: n/a
MLH
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
MLH wrote:
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.


Check the form's property sheet for OnError event. Check if the DataErr
value is 3315 and enter your own error message. Ex:
If DataErr = 3315 then
msgbox "Sorry, we need some data"
Response = acdataerrcontinue
Endif

Nov 13 '05 #2

P: n/a
MLH
Thx, Salad. Haven't used that one before.
Will come in handy.

Check the form's property sheet for OnError event. Check if the DataErr
value is 3315 and enter your own error message. Ex:
If DataErr = 3315 then
msgbox "Sorry, we need some data"
Response = acdataerrcontinue
Endif


Nov 13 '05 #3

P: n/a
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus from
leaving the textbox.

I prefer this approach over the Form_Error, because it lets you handle this
error on its own; Form_Error will be triggered for any error which was not
previously handled.

"MLH" <CR**@NorthState.net> wrote in message
news:kr********************************@4ax.com...
I get error 3315 when attempting to enter ZLS into
a text-type table field whose allow zls property is set
to false. The error says "Field MyTable.MyField can't
be a zero-length string"

For sure, this is what I expected, entering into a table.

The same 3315 error occurs if you try to enter "" into
a bound textbox control on a form (bound to the same
field. I expected that too.

I was wondering if its possible to trap this error and process
it with my own error-handler - when I see it form an open form.
Is this possible? And, if so, which of the applicable textbox
event properties should I try to do it in? I'm not sure it can be
done, as the ZLS is disallowed at the table level - not at the
form level.

Nov 13 '05 #4

P: n/a
MLH
Well now, that's interesting. I've heard of CancelEvent but not of
Cancel being used this way (set to True, that is). Searching HELP
in A97, I saw several things regarding Cancel. But nothing I saw
treated Cancel like an object that could be set to True or False.
I would appreciate a short code snippet - if you're feeling froggy.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxx
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus from
leaving the textbox.

I prefer this approach over the Form_Error, because it lets you handle this
error on its own; Form_Error will be triggered for any error which was not
previously handled.


Nov 13 '05 #5

P: n/a
MLH wrote:
Well now, that's interesting. I've heard of CancelEvent but not of
Cancel being used this way (set to True, that is). Searching HELP
in A97, I saw several things regarding Cancel. But nothing I saw
treated Cancel like an object that could be set to True or False.
I would appreciate a short code snippet - if you're feeling froggy.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxx
I'd tend to use the texbox's BeforeUpdate event procedure:
You'd check for Err=3315, and set Cancel=True to prevent focus
from leaving the textbox.

I prefer this approach over the Form_Error, because it lets you
handle this error on its own; Form_Error will be triggered for any
error which was not previously handled.


Some events have a Cancel argument in the definition. Any that do can have that
argument set to zero within the event's code. BeforeUpdate is one such event.

--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.