Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: AW: RE: Data validation


Message #1 by "Grau Kilian (rds)" <rds@a...> on Mon, 30 Sep 2002 18:20:52 +0200




AW: [pro_vb] RE: Data validation



I agree to Peter


If the validation is a similar check like :
a date between 20.06 and 30.06 


So I prefer to use the validate event


And normally I never place validation check into a class, because of it is wrong
when you want to build a '3 tier' application


Chers
Kilian


-----Ursprüngliche Nachricht-----
Von: Peter N. Kipe [mailto:pkipe@c...]
Gesendet: Montag, 30. September 2002 17:38
An: professional vb
Betreff: [pro_vb] RE: Data validation



This is a complicated issue.  If you use the class approach, then you have
to decide what form event should cause validation to occur.  If you wait
until a save button is clicked, then you may be holding simple keystroke
error notification until long after the offending keystrokes were made.  In
any case, this approach could force multiple error message/correction cycles
to occur, one right after the other, until all field-level and relational
edits have been completed without error.  Such a string of errors can be
annoying to many users.


I personally prefer to use the Validate event to catch most of the simple
keystroke stuff, then fire off a relational edit just prior to saving data.
Placing that code in a class is an option, but it would only help in the
area of code organization -- it's unlikely that an app will have two forms
containing the same fields and edits which would enable the class to be
reusable.


Pete


-----Original Message-----
From: martin.scullion@u...
[mailto:martin.scullion@u...]
Sent: Monday, September 30, 2002 9:48 AM
To: professional vb
Subject: [pro_vb] Data validation



I have a simple data input type form, the data from which requires simple
validation rules, now my question is this where do I put the validation.


I have several options :-


1). On the form itself invoked by a click event.
2). The fields will be passed to a class so I could alternatively validate
at the property let Procedure.
3). On_Validate event


My Personal preference is option 2 as I can then control the validation in
one area (The Class Module) and throw errors as appropriate.


Has anyone else any thoughts ???


---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills
from Visual Basic 6 to C#, the language of choice
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059






---
Visual C# - A Guide for VB6 Developers
This book will make it easy to transfer your skills 
from Visual Basic 6 to C#, the language of choice 
of the .NET Framework.
http://www.wrox.com/ACON11.asp?ISBN=1861007175&p2p0059







  Return to Index