Hi,
Could you help me how to construct a ComboBox Control from two fields of a table:
I've tried something like this but at the line
i get a syntax error message
Thank you,
Dan C. Nagy
Could you help me how to construct a ComboBox Control from two fields of a table:
I've tried something like this but at the line
Code:
frmMyForm.cbxnAnul.RowSource=field state.nume_luna, state.an
Thank you,
Dan C. Nagy
Code:
use state.dbf in 1 alias state exclusive
select state
frmMyForm = CREATEOBJECT('MyForm')
frmMyForm.AddObject('cbxnAnul','ComboBox')
frmMyForm.cbxnAnul.Visible=.T.
frmMyForm.cbxnAnul.Left=220
frmMyForm.cbxnAnul.Top=32
frmMyForm.cbxnAnul.Width=50
frmMyForm.cbxnAnul.FontSize=8
frmMyForm.cbxnAnul.RowSourceType=6
&& i get a syntax error message at the next line
frmMyForm.cbxnAnul.RowSource=field state.nume_luna, state.an
frmMyForm.cbxnAnul.ControlSource=m.lunaaleg
frmMyForm.Show(1)
DEFINE CLASS cmdMyCmndBtn AS CommandButton && Create Command button
Caption = '\<Iesire' && Caption on the Command button
Cancel = .T. && Default Cancel Command button (Esc)
Left =615 && Command button column
Top = 450 && Command button row
Height = 20 && Command button height\da
Width=70
FontSize=8
PROCEDURE Click
THIS.Parent.Release()
ENDDEFINE
DEFINE CLASS cmdMyCmndBtn1 AS CommandButton && Create Command button
Caption = '\<Continua' && Caption on the Command button
Cancel = .T. && Default Cancel Command button (Esc)
Left = 285 && Command button column
Top = 32 && Command button row
Height = 20 && Command button height\da
Width=70
FontSize=8
PROCEDURE Click
ENDDEFINE
DEFINE CLASS MyForm AS Form
Width=750
Height=500
Caption="LISTARE AVANS"
Closable = .F. && Disable the Control menu box
BorderStyle=2
DataSession=1
&& DataEnvironment=DE
ADD OBJECT cmdCommand1 AS cmdMyCmndBtn
ADD OBJECT cmdCommand2 AS cmdMyCmndBtn1
ADD OBJECT lblTitlu AS Label WITH ;
Visible=.T.,;
Left=10,;
Top=4,;
FontBold=.T.,;
FontSize=16,;
BackStyle=0,;
AutoSize=.T.,;
Caption="LISTARE AVANS"
ADD OBJECT lblluna AS Label WITH ;
Visible=.T.,;
Left=10,;
Top=34,;
FontBold=.T.,;
FontSize=8,;
BackStyle=0,;
AutoSize=.T.,;
Caption="Pe luna:"
ADD OBJECT lblan AS Label WITH ;
Visible=.T.,;
Left=165,;
Top=34,;
FontBold=.T.,;
FontSize=8,;
BackStyle=0,;
AutoSize=.T.,;
Caption=" din anul:"
ENDDEFINE