Question : Fox 9 Validation routine

In my command button click event which exits a form ,I have placed a validation routine prior to the updatetable()  command it goes something like this

if thisform.txtlast.value="     "
=messagebox("Fix  Last Name")
return 0
Endif


This works fine. It would be better if  after clicking ok on the message box if the user could be returned directly to the text box with the problem. How could that be done I played with the return command couldn't get that to do it and could not find anything in the help menus.


Thank You
D

Answer : Fox 9 Validation routine

IF EMPTY(Thisform.txtlast.Value)
  = MESSAGEBOX("Entering Last name is mandatory!").
  Thisform.txtlast.SetFocus
ENDIF
Random Solutions  
 
programming4us programming4us