>>I have a form that has 20 buttons. I want to set each button label based on a table that may change from time to time i.e. button 1 label = record 1, Button 2 label = record 2 etc. How do I go about doing this? Any help would be great.
>>Thanks
>>Bill Pritchard
>
>In the Init method of your form you could have code that goes through all the controls on the form, lloking for command buttons. When you find one, change it's caption.
>
>nCounter = 0
>FOR EACH oCtrl IN thisform
> IF oCtrl.BaseClass="Commandbutton"
> nCounter = nCounter + 1
> oCtrl.Caption = "Record "+ALLTRIM(STR(nCounter))
> ENDIF
>ENDIF
>ENDFOR
>
Gah! that should be:
FOR EACH oCtrl IN thisform.Controls