Hi everyone,
i found a very good use for DataSource. I simply add in some string eg “SaleDetails” in the Sale Details tab for all the field i want to initialize (eg setting text to “” and checkbox to false) and i use the following codes to set all those fields
DIM i AS integer,j AS integer
DIM vctrl AS Control
j=self.controlcount - 1
for i = 0 to j
vctrl=self.Control(i)
if vCtrl isa TextField then
IF TextField(vCtrl).DataSource="SaleDetails" THEN
TextField(vCtrl).Text=""
END IF
elseif vCtrl isa TextArea then
IF TextArea(vCtrl).DataSource="SaleDetails" THEN
TextArea(vCtrl).Text=""
END IF
elseif vCtrl IsA CheckBox then
IF CheckBox(vCtrl).DataSource="SaleDetails" THEN
CheckBox(vCtrl).Value=False
END IF
elseif vCtrl IsA Combobox then
IF Combobox(vCtrl).DataSource="SaleDetails" THEN
Combobox(vCtrl).Text=""
Combobox(vCtrl).ListIndex=-1
END
END IF
Next