Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 15th, 2004, 02:56 PM
Registered User
 
Join Date: Mar 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validations...

Hello

I've got my flexgrid set up and various text boxes. Once information has been entered into the text boxes and the command button executed the information is entered into the flexgrid. How do I validate it so it comes up with an error if I enter into the wrong information... like using numbers where text should be, for example.

Please help
Thanks
Flunders
 
Old March 27th, 2004, 07:27 AM
Registered User
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are quite a few ways to do this ... just depends at which point you want to do the checking. The textbox keypress event, validate event (caveat: only triggered if control you are moving to has 'causesvalidation' property set to true), change event. If you are doing field level validation for basic alphanumeric filtering then the keypress event is a good place to start. If you have more complex needs, the validate event might be more appropriate.

HTH.

Shane.
 
Old September 28th, 2004, 10:48 AM
Authorized User
 
Join Date: Sep 2004
Posts: 55
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Lalit_Pratihari
Default

Hi,

Shane is right. Validation could be control level or form level.
If you want a field level validation then you have to check for the value in keypress, change or lostfocus events.
And if you want to have a form level validation then you will have to validate the entries once you feed in the value into the various controls and while saving it into the flexgrid control.

Hope this helps,

Lalit
Life Means More...;)
 
Old September 29th, 2004, 07:09 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 109
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Anantsharma Send a message via Yahoo to Anantsharma
Default

Well u can create a class module to which u can pass the control and validate its value varifying the datatype required. I suggest to create matrix (table) whic will hold the control name in Controls collection and its valid datatype datatype. In this way u can loop through the controls, pass the control name, it will pick datatype from table and validate through code and return an error value (should be string type so that u can from an error string in class odule).

Hope u got my point.

B. Anant





Similar Threads
Thread Thread Starter Forum Replies Last Post
Validations in dataGrid p2pMember ASP.NET 1.0 and 1.1 Basics 1 December 7th, 2005 08:17 PM
problem with validations ashokparchuri General .NET 1 April 14th, 2005 08:20 AM
Validations through ASP ashu_gupta75 Classic ASP Basics 7 April 21st, 2004 06:07 AM
Validations not working Ajay Jain ASP.NET 1.0 and 1.1 Basics 1 February 24th, 2004 01:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.