Hi Experts,
can i select from a grid column, in my case the column is "purno", the "cell value" of a particular record and then store this value in variable in order to open another form or run a report, to display more information related with that purchase order number ?
in other words, i would like to either double click or click the value in cell located under the column "purno" and then once we picked the vaue of that cell, then run a report to display more data related to that purno, that was not included in that grid record cause otherwise the grid will be to long to scroll horizontally ?
i need to be able to click or double click, from the Grid under the "purno" column a value and run a report using that value as the key to find the rest of the data related with it.
can you please suggest ?
Here is the code i have to create the grid, by the way the grid was just created by dropping the Grid control in the form, so i use the code below to fill the grid with data, so i don't know how to accomplish what i am asking.
can you please suggest ?
Thanks in advance
can i select from a grid column, in my case the column is "purno", the "cell value" of a particular record and then store this value in variable in order to open another form or run a report, to display more information related with that purchase order number ?
in other words, i would like to either double click or click the value in cell located under the column "purno" and then once we picked the vaue of that cell, then run a report to display more data related to that purno, that was not included in that grid record cause otherwise the grid will be to long to scroll horizontally ?
i need to be able to click or double click, from the Grid under the "purno" column a value and run a report using that value as the key to find the rest of the data related with it.
can you please suggest ?
Here is the code i have to create the grid, by the way the grid was just created by dropping the Grid control in the form, so i use the code below to fill the grid with data, so i don't know how to accomplish what i am asking.
can you please suggest ?
Thanks in advance
Code:
thisform.label5.VISIBLE=.t.
thisform.label5.Enabled=.t.
thisform.Refresh()
doevents
PUBLIC lcJob_no
SET EXCLUSIVE OFF
SET SAFETY OFF
SET CPDIALOG OFF
lcjob_no= thisform.txtTextBox.Value
thisform.label5.VISIBLE=.t.
thisform.label5.Enabled=.t.
path_1="S:\PRO50\APEX04\POTRAN04" &&VFP 5.0 TABLE TYPE
path_2="F:\MFG\ENG_JOBS" && FOXPRO DOS 2.0 TABLE
path_3="F:\MFG\INS_LOG" && FOXPRO DOS 2.0 TABLE
path_4 ="s:\pro50\apex04\apvend04" &&VFP 5.0 TABLE TYPE
Select INT(VAL(t1.dept)) as ball_no, sht as Sheet, INT(t1.QtyOrd) as QTYORD, INT(t1.Qtyrec) as QTYREC, t4.company as VendorName, t2.part_type as PRC, t2.draw_no, t1.item as ItemNo, t1.vpartno as vendorpartno, ;
t1.descrip, t1.Recdate, t1.purno;
From (path_1) t1 ;
INNER Join (path_2) t2;
ON INT(VAL(t2.ball_no)) = INT(VAL(t1.dept));
INNER JOIN (path_4) t4;
ON t1.vendno = t4.vendno;
WHERE t1.reqno= lcJob_no AND t2.job_no=lcJob_no ;
ORDER BY 1,2,8 INTO Cursor RESULS1 readwrite
Local lnValue, lcSuffix, lcSheet
Scan
lnValue = ball_No
lcSuffix = Iif(Between(Asc(Right(Alltrim(draw_no),1)),48,57),'',Right(Alltrim(draw_no),1))
Do Case
Case Between(m.lnValue,1,999)
lcSheet = substr(ALLTRIM(Transform(m.lnValue,"9999999")),1,1)+m.lcSuffix
* Since converting character to integer will loose zeroes on
* the > left, then override those that are less than 200
If m.lnValue < 200
lcSheet = '1'+m.lcSuffix
Endif
Case Between(m.lnValue,8000,8999)
lcSheet = ''
Case Between(m.lnValue,7000,7999)
lcSheet = '7'+m.lcSuffix
Case Between(m.lnValue,9000,9999)
lcSheet = '9'+m.lcSuffix
Otherwise
lcSheet = substr(ALLTRIM(Transform(m.lnValue,"9999999")),2,1)+m.lcSuffix
Endcase
Replace sheet With m.lcSheet
ENDSCAN
GO top
Select ball_no, Sheet, QTYORD, QTYREC, VendorName, PRC, ItemNo, vendorpartno, ;
descrip, Recdate, purno;
From RESULS1 ORDER BY 1 INTO Cursor RESULS2 readwrite
thisform.label5.VISIBLE=.f.
thisform.label5.Enabled=.f.
If _Tally > 0
With Thisform.grid2
.Visible = .T.
.ColumnCount = -1
.RecordSource = 'resuls2'
.Refresh()
.Setall("DynamicBackColor", "IIF(resuls2.qtyord = resuls2.qtyrec, RGB(255,255, 0), 0xFFFFFF)") &&255, 255, 0 yellow
.Column3.DynamicForeColor= "IIF(resuls2.qtyord= resuls2.qtyrec, RGB(255,0,0),RGB(0,0,0))"
.Column4.DynamicForeColor= "IIF(resuls2.qtyord= resuls2.qtyrec, RGB(255,0,0),RGB(0,0,0))"
ENDWITH
thisform.buttonx1.Visible = .t.
Thisform.buttonx1.Enabled =.T.
Thisform.Sstoexcel21.Enabled=.T.
Thisform.command4.Enabled=.T.
Thisform.command2.Enabled=.T.
thisform.command1.Enabled= .F.
thisform.label3.Enabled=.T.
thisform.label3.VISIBLE=.T.
Thisform.Text1.visible=.T.
thisform.label7.VISIBLE=.t.
Else
Messagebox('There is not result for your Query, Check again your Entry',0+64,'Ok!')
thisform.command1.Enabled= .F.
Thisform.command4.enabled=.F.
Thisform.command2.enabled=.t.
thisform.label3.Enabled=.f.
thisform.label3.VISIBLE=.f.
thisform.buttonx1.Visible = .f.
Thisform.buttonx1.Enabled =.f.
Thisform.TxtTextBox.Value=''
thisform.label7.VISIBLE=.f.
Thisform.Text1.visible=.F.
Thisform.TxtTextBox.SetFocus
With Thisform.grid2
.Visible = .F.
.ColumnCount = -1
.RecordSource = ''
Endwith
Endif