Jump to content
Sign in to follow this  
rblloyd

Creating a Validation Script???

Recommended Posts

I have a form in my database that is used to gather quite a bit of information. If I wanted to create a script that would check key fields that might have been left blank during the data entry process, what would be the best way of going about it? Thanks for your help!

Share this post


Link to post
Share on other sites

You must be sure that there is only one way off the form, and that button will run your validation script. So, I'd suggest that the form is a popup window. For example:

1. User clicks "Enter Data" button which does a new window and switches to the form layout, does a new record and pauses so that the window is modal (they can't click the window that is behind.

2. The form window has two buttons "Save" and "Cancel" and each is set to Exit the current script (remember you're in a pause). "Cancel" deletes the new record and closes the window--no validation, obviously.

3. "Save" runs your validation script. Simply do a series of If End statements, such as:

If ( isempty( Name))

Show Custom Dialog [ Please enter a value for Name]

Exit Script

End If

If ( another validation calc)

Exit Script

End If

Commit Records (no dialog)

Close Window

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.