Hi,
In grid I have multiple column, On second column valid event I have written some validation. If user press enter all related record displaying , On selection of one record further thirs and fourth column displaying value as per my validation.
But cursor not going on second column. Either i press tab,enter or mouse click on other column same valid event firsing and cursor staying there while i am not using any do while loop etc.
Is there anyother event to use in grid column validation?
Code used in valid event is as follows.
publ y
y=0
*IF Subsidiary code IS BLANK EXECUTE THIS LINE
factp=thisform.grid1.column1.combo1.value
fsbcd=thisform.grid1.column2.text1.value
If len(ALLT(fsbcd)) = 0
if factp="C"
select code,name,GLCODE from customer order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.column2.text1.refresh()
*dodefault()
retu
else
return .f.
endi
endi
if factp="S"
select code,name,GLCODE from supplier order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.refresh()
retu
else
return .f.
endi
endi
if factp="B"
select code,name,GLCODE from bank order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.refresh()
retu
else
return .f.
endi
endi
if factp="P"
select code,name,GLCODE from project order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.refresh()
retu
else
return .f.
endi
endi
if factp="V"
select code,name,GLCODE from vehicle order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.refresh()
retu
else
return .f.
endi
endi
if factp="L"
select code,name,GLCODE from location order by code into cursor curcust
do form help1
if y=1
thisform.grid1.column2.text1.value=ccust
THISFORM.grid1.column3.text1.VALUE=SUBS(CURCUST.GLCODE,1,8)
THISFORM.grid1.column4.text1.VALUE=SUBS(CURCUST.GLCODE,9,6)
thisform.grid1.refresh()
retu
else
return .f.
endi
endi
endi
endi
Any suggestion highly appreciated.
Sajjad Ahmad