insertBut.click
runs in the context of myForm.insertBut
, not myForm
, which has text1
et al.
You need to prefix the calls to the form's other objects with THISFORM
.
A better solution, btw, is to data-bind the text boxes to either a cursor or a data object, so that you get a better seperation of concerns. You can either add a custom object explicitly in the class description, or just launch or create a cursor directly.
Either open or check for the stock
cursor on the Init
method of myForm
, and then just set each control's dataSource
property as you create it. For example:
ADD OBJECT text1 AS TEXTBOX WITH ;
left = 10, ;
top = 25, ;
dataSource = 'stock.title'