title: powerbuilder datawindow validate records
body: <p>close to 3 months into powerbuilder classic 12.5 and sql server 2008 and am working out well. <br> I am creating a car hire system using car registration_number as the primary key. <br></p>
  
  <p>i need to capture the car's details and make sure that the registration_number is not available. The code here is not working but that of the capacity works out... </p>
  
  <ol>
  <li><p>What is wrong with the code? please give another way that works.</p></li>
  <li><p>if i dont click on the column 'capacity' and click on save, the program goes on and saves the record even when it is an empty field. how to i avoid that.</p>
  
  <pre><code>  String car_registration_number
   car_registration_number = dw_newvehicle.GetItemString( Row, "registration_number" )
   long error_code = 0
   string  column
   column = dwo.name
   choose case column
      case "registration_number"
          if data = car_registration_number THEN
              messagebox("validation error", "You cannot available regno")
              error_code = 1   
          end if
      case "capacity"
          if integer(data) &gt;10 then 
             messagebox("validation error", "a car's capacity cannot be more than 10...")
           error_code = 1  
          end if
   end choose
   return error_code
  </code></pre></li>
  </ol>