[AccessD] Data Validation on Form - A97

Bob Gajewski bob at renaissancesiding.com
Thu Mar 27 12:54:07 CST 2003


Donald

It sounds like you're in the right area; it may just be the actual code 
that needs tweaking. Please post your code so that we can better assist 
you.

Regards,
Bob Gajewski

On Thursday, March 27, 2003 13:29 PM, Mcgillivray, Donald [LTD] 
[SMTP:donald.a.Mcgillivray at mail.sprint.com] wrote:
> Ok, I guess I really am clueless
>
> I'm trying to intercept control values on a form prior to their being 
pushed
> to the underlying table so I can validate user entries and display my own
> error message and prompt for re-entry if necessary.
>
> I have a VERY simple bound form/subform.  The main form has only two
> controls: txtPersonID and txtDate (bound to their respective fields) the
> combination of which defines a unique index in the underlying table; the
> subform contains the child records for the person/date combination 
specified
> on the main form
>
> I've put code in the BeforeUpdate events of both the form and the date
> control (separately - not at the same time), and so far have been unable 
to
> get my code to fire when deliberately violating the person/date index 
rule
> Instead, I get the default warning (from Jet, I think?) about the new 
record
> violating the table's indexing rules.  I guess the record is getting 
pushed
> to the table BEFORE the BeforeUpdate event fires.  Access then takes 
over,
> testing the validity of the entry and sending its own message, which (I
> promise) will only confuse my users.  I have also tried using the form's
> BeforeInsert event, but that causes my code to fire at the first 
keystroke
> on the clean form (before there's any data to validate.)
>
> Obviously, I'm misunderstanding the use of these events for validation, 
or
> I'm adopting an incorrect strategy for dealing with this issue.  Anybody 
out
> there willing to escort me out of the woods or offer alternative 
solutions?
>
> Thanks!
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
> 



More information about the AccessD mailing list