Hi Friends,
I am a new comer to VFP 9. I have made a form to search a record from ABC.DBF by Student's Name or By Father's Name from Command window just writing Modify Form Search. On that form there is a text box (Text1), one option group (1-Student's Name or 2-Father's Name) and a grid to show the searched data. I have given the code as below in InteractiveChange method of Text1.
==========
thisform.grid1.Column1.resizable=.F.
IF thisform.optiongroup1.option1.Value=1
SELECT s_name, f_name, stud_id FROM ABC;
WHERE ALLTRIM(UPPER(this.Value)) $ UPPER(s_name) ORDER BY s_name INTO CURSOR sf_name
thisform.grid1.RecordSource="sf_name"
ELSE
IF thisform.optiongroup1.option2.Value=1
SELECT s_name, f_name, stud_id FROM ABC;
WHERE ALLTRIM(UPPER(this.Value)) $ UPPER(f_name) ORDER BY f_name INTO CURSOR sf_name
thisform.grid1.RecordSource="sf_name"
ENDIF
ENDIF
thisform.refresh
==========
Also in Autofit method of grid I have the code as below
with thisform.Grid1
.Columns( .columnCount ).Width = 75
.Columns( .columnCount ).resizable = .f.
endwith
==========
The problem is : The columns of grid are being squeezed when any record matches to the search criteria of Text1.
So please suggest how to solve the grid squeeze problem.
Thank you all.
I am a new comer to VFP 9. I have made a form to search a record from ABC.DBF by Student's Name or By Father's Name from Command window just writing Modify Form Search. On that form there is a text box (Text1), one option group (1-Student's Name or 2-Father's Name) and a grid to show the searched data. I have given the code as below in InteractiveChange method of Text1.
==========
thisform.grid1.Column1.resizable=.F.
IF thisform.optiongroup1.option1.Value=1
SELECT s_name, f_name, stud_id FROM ABC;
WHERE ALLTRIM(UPPER(this.Value)) $ UPPER(s_name) ORDER BY s_name INTO CURSOR sf_name
thisform.grid1.RecordSource="sf_name"
ELSE
IF thisform.optiongroup1.option2.Value=1
SELECT s_name, f_name, stud_id FROM ABC;
WHERE ALLTRIM(UPPER(this.Value)) $ UPPER(f_name) ORDER BY f_name INTO CURSOR sf_name
thisform.grid1.RecordSource="sf_name"
ENDIF
ENDIF
thisform.refresh
==========
Also in Autofit method of grid I have the code as below
with thisform.Grid1
.Columns( .columnCount ).Width = 75
.Columns( .columnCount ).resizable = .f.
endwith
==========
The problem is : The columns of grid are being squeezed when any record matches to the search criteria of Text1.
So please suggest how to solve the grid squeeze problem.
Thank you all.