For future reference you will find that you will be more likely to get replies to your questions, if you supply as much detail as you can in your question (exactly the kind of thing most programmers would like from their end-users right?) Basic pieces of information to supply are what version of PB are you using and what database is your application connecting to?
Apart from this, I believe that I can answer your question...
Rather that adding all the text to this section, I would ask you to access the PowerBuilder help on this subject. Please have a look at Chapter 16 Displaying and Validating Data - Working with Validation Rules. This section of the help covers the subject quite well.