Greetings again, I hope this board doesnt have a limit
on the number of foolish posts... I may be reaching it.
I have yet another question that I fear will be an all
too obvious answer, but for the life of me cant find it
(and the Help file seems to contradict reality).
Here is what is happening. I have a table based form
(all the controls in this form are linked to a customer
table). This form has txtboxes for Name, Address, City,
State, Zip, etc.
An example of my problem is this. In my table I have
the Zip code field as a long int (so it can hold the
numeric equiv of a zip code). In my form I am trying
to validate any data entry, and give an appropriate err
msg (rahter than the generic one Access provides).
If I enter a letter for the zip code and try to change
to another control, I get a message saying that I am
violating the data-type for the field that this control
is bound to. Its ignoring the validation I have setup
for the control!
Some examples of validation I have tried for the control
(and none have caught/fired/)....
...but none of these seem to be working (at least not
before the validation for the underlying table is firing).
I thought of using form_before(update/insert) but this
will only do validation for the first control correct?
These events are fired off when the first control is
altered, and wouldnt be fired off again (to check each
control as it is altered).
The help file states that (quoted)...
[tt]
Order of Validation for controls and fields
Validation rules for controls and fields are evaluated
in the following order:
1. Macro or event procedure validation (for example,
a macro or an event procedure that responds to the
BeforeUpdate event of the control or the form containing
the control)
2. The control's ValidationRule property
3. The underlying table's validation rules for the
field (as set in the field's ValidationRule, Required,
and AllowZeroLength properties)
4. The underlying table's ValidationRule property
(this property performs validation on records)
[/tt]
Ideas?
Travis
on the number of foolish posts... I may be reaching it.
I have yet another question that I fear will be an all
too obvious answer, but for the life of me cant find it
(and the Help file seems to contradict reality).
Here is what is happening. I have a table based form
(all the controls in this form are linked to a customer
table). This form has txtboxes for Name, Address, City,
State, Zip, etc.
An example of my problem is this. In my table I have
the Zip code field as a long int (so it can hold the
numeric equiv of a zip code). In my form I am trying
to validate any data entry, and give an appropriate err
msg (rahter than the generic one Access provides).
If I enter a letter for the zip code and try to change
to another control, I get a message saying that I am
violating the data-type for the field that this control
is bound to. Its ignoring the validation I have setup
for the control!
Some examples of validation I have tried for the control
(and none have caught/fired/)....
Code:
>9999 And <99999 or is null
Like "?????" or is null
(IsNumeric([Zip])=True And Len([zip])<6) Or Is Null
before the validation for the underlying table is firing).
I thought of using form_before(update/insert) but this
will only do validation for the first control correct?
These events are fired off when the first control is
altered, and wouldnt be fired off again (to check each
control as it is altered).
The help file states that (quoted)...
[tt]
Order of Validation for controls and fields
Validation rules for controls and fields are evaluated
in the following order:
1. Macro or event procedure validation (for example,
a macro or an event procedure that responds to the
BeforeUpdate event of the control or the form containing
the control)
2. The control's ValidationRule property
3. The underlying table's validation rules for the
field (as set in the field's ValidationRule, Required,
and AllowZeroLength properties)
4. The underlying table's ValidationRule property
(this property performs validation on records)
[/tt]
Ideas?
Travis