>>IF thisform.text2.value=ALLTRIM("Residential") AND thisform.text1.Value < 1 OR thisform.text1.Value>5 >> =MESSAGEBOX("out of range") >> thisform.text1.SetFocus >>ENDIF >>IF thisform.text2.value=ALLTRIM("Business") AND thisform.text1.Value < 1 OR thisform.text1.Value>4 >> =MESSAGEBOX("out of range") >> thisform.text1.SetFocus >>ENDIF >>>>thanks.
>lcText2Val = UPPER(ALLTRIM(thisform.text2.value)) > >IF INLIST(lcText2Val, [RESIDENTIAL],[BUSINESS]) AND NOT; > BETWEEN(thisform.text1.Value, 1, IIF(lcText2Val == [RESIDENTIAL] 5, 4)) > =MESSAGEBOX("out of range") > thisform.text1.SetFocus() >ENDIF >>About where you must put this code, I don't know becuase I don't know what you want to do and WHERE you want to do it.