best way to validate data in forms; 2010

C

cate

I know how to use validation in cells and I know how to build basic
forms. (lol - aren't I smart).

What's the best way to validate data entered from a form. I don't
want anything getting on a sheet that isn't valid. I need the user to
fix everything before the save is executed.

So far it looks like a lot of coding to accomplish this. How is this
generally done? How do you pros do it?
Validation would cover numeric ranges, dates, ... standard stuff I
guess.

Thank you.
 
W

witek

cate said:
I know how to use validation in cells and I know how to build basic
forms. (lol - aren't I smart).

What's the best way to validate data entered from a form. I don't
want anything getting on a sheet that isn't valid. I need the user to
fix everything before the save is executed.

So far it looks like a lot of coding to accomplish this. How is this
generally done? How do you pros do it?
Validation would cover numeric ranges, dates, ... standard stuff I
guess.

Thank you.

'------------------------------------------------

sub button_ok
if validate () then unload me

end sub

'--------------------------------------------------
function validate as boolean



if txt.value == "" then

msgbox "txt cannot be empty"
txt.setfocus
exit function


if ....... then

end if


validate = true

end function

'----------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top