>if thisform.pagefram1.page1.text1.value>2 OR thisform.pagefram1.page1.text1.value < 0 >=messagebox("hihihihi") >else...... >In the simplest case, WITH...ENDWITH can help:
WITH thisform.pagefram1.page1.text1 IF .Value > 2 OR .Value < 0 ... ELSE ... ENDIF ENDWITHMore generally, what sometimes happens is you want to run code in, for example, the Text1.Valid(). So what you do is:
* Text1.Valid() RETURN ThisForm.SomeMethod() * ThisForm.SomeMethod() WITH ... * as above ENDWITHInstead, what you can do is pass an "object reference" to ThisForm.SomeMethod, which simplifies your code as follows:
* Text1.Valid() RETURN ThisForm.SomeMethod(This) * ThisForm.SomeMethod() LPARAMETERS ; toTextBox IF toTextBox.Value > 2 ... * etc.