I have 2 forms, one is the main form and the other one is for the details.
The first form consists of a grid and add,edit,delete commands.
The other one consists of textboxes with labels to input necessary details such as idno, name, address, etc.
When clicking the Add command all textboxes are set to enabled = true
My problem is...
When clicking the Edit button I want the idno and name textboxes to be enabled = false and the others true.
I have this codes in the init of the second form:
PARAMETERS cMode
thisform.txtDate.Tag = ALLTRIM(cMode)
DO CASE
CASE VAL(cMode) = 1
thisform.txtID.Enabled = .t.
thisform.txtName.Enabled = .t.
thisform.txtAddress.Enabled = .t.
thisform.txtBdate.Enabled = .t.
thisform.txtAge.Enabled = .t.
thisform.txtStatus.Enabled = .t.
CASE VAL(cMode) = 2
thisform.txtID.Enabled = .f.
thisform.txtName.Enabled = .f.
thisform.txtAddress.Enabled = .t.
thisform.txtBdate.Enabled = .t.
thisform.txtAge.Enabled = .t.
thisform.txtStatus.Enabled = .t.
ENDCASE
And in the Add command (Click):
DO FORM frm_detl WITH "", 0, thisform.Tag
Edit command (Click):
DO FORM frm_detl WITH tmp_info.idno, 1, thisform.Tag
I can't figure why it doesn't work..
Really need your help...
Thanks!
The first form consists of a grid and add,edit,delete commands.
The other one consists of textboxes with labels to input necessary details such as idno, name, address, etc.
When clicking the Add command all textboxes are set to enabled = true
My problem is...
When clicking the Edit button I want the idno and name textboxes to be enabled = false and the others true.
I have this codes in the init of the second form:
PARAMETERS cMode
thisform.txtDate.Tag = ALLTRIM(cMode)
DO CASE
CASE VAL(cMode) = 1
thisform.txtID.Enabled = .t.
thisform.txtName.Enabled = .t.
thisform.txtAddress.Enabled = .t.
thisform.txtBdate.Enabled = .t.
thisform.txtAge.Enabled = .t.
thisform.txtStatus.Enabled = .t.
CASE VAL(cMode) = 2
thisform.txtID.Enabled = .f.
thisform.txtName.Enabled = .f.
thisform.txtAddress.Enabled = .t.
thisform.txtBdate.Enabled = .t.
thisform.txtAge.Enabled = .t.
thisform.txtStatus.Enabled = .t.
ENDCASE
And in the Add command (Click):
DO FORM frm_detl WITH "", 0, thisform.Tag
Edit command (Click):
DO FORM frm_detl WITH tmp_info.idno, 1, thisform.Tag
I can't figure why it doesn't work..
Really need your help...
Thanks!