Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Choose from grid to print preview
Message
 
 
To
22/08/2004 14:21:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00934458
Message ID:
00935355
Views:
19
>hi,
>
>i hope if you have a time to check this code,
>this code explaine what i did at myform.
>
>
>**1- this code at thisform.text24.valu &&&
>***********************
>LPARAMETERS nKeyCode, nShiftAltCtrl
>IF NKEYCODE=13
>SELECT 1
>SET FILTER TO ALLTRIM(NO)=UPPER(ALLTRIM(THISFORM.TEXT24.VALUE))
>local lcvalue
>THISFORM.GRID4.REFRESH
>THISFORM.TEXT23.VALUE=SPAC(10)
>lcvalue=[']+UPPER(ALLTRIM(THISFORM.TEXT24.VALUE))+[']
>LOCATE FOR ALLTRIM(NO)=&lcvalue
>IF FOUND()
>THISFORM.GRID4.REFRESH
>THISFORM.GRID4.VISIBLE=.T.
>ELSE
>=MESSAGEBOX("NOT FOUND")
>ENDIF
>ENDIF
>
>****2-this code  at grid4&&
>*************************************
>LPARAMETERS nKeyCode, nShiftAltCtrl
>thisform.text1.value=BOOK1.no
>thisform.text2.value=nam
>thisform.text8.value=total
>thisform.text3.value=min
>thisform.text1.visible= .T.
>thisform.text2.visible= .T.
>
>SELECT 2
>SET FILTER TO ALLTRIM(NO)==UPPER(ALLTRIM(THISFORM.TEXT1.VALUE))
>SUM SPIND TO THISFORM.TEXT11.VALUE
>THISFORM.TEXT9.VALUE=THISFORM.TEXT10.VALUE-THISFORM.TEXT11.VALUE
>SUM INCOM TO THISFORM.TEXT10.VALUE
>THISFORM.TEXT9.VALUE=THISFORM.TEXT8.VALUE+THISFORM.TEXT10.VALUE-THISFORM.TEXT11.VALUE
>thisform.text8.visible= .t.
>thisform.text10.visible= .t.
>thisform.text11.visible= .t.
>thisform.text9.visible= .t.
>thisform.command9.visible= .t.
>thisform.command11.visible= .t.
>thisform.command12.visible= .t.
>thisform.command10.visible= .t.
>thisform.line1.visible= .t.
>thisform.line2.visible= .t.
>thisform.line3.visible= .t.
>thisform.line4.visible= .t.
>
>SELECT 1
>thisform.text1.value=no
>thisform.text2.value=nam
>thisform.text8.value=total
>
>SELECT 2
>SET FILTER TO ALLTRIM(NO)==UPPER(ALLTRIM(THISFORM.TEXT1.VALUE))
>SUM SPIND TO THISFORM.TEXT11.VALUE
>THISFORM.TEXT9.VALUE=THISFORM.TEXT10.VALUE-THISFORM.TEXT11.VALUE
>SUM INCOM TO THISFORM.TEXT10.VALUE
>THISFORM.TEXT9.VALUE=THISFORM.TEXT8.VALUE+THISFORM.TEXT10.VALUE-THISFORM.TEXT11.VALUE
>
>select 2
>locate for ALLTRIM(no)==upper(ALLtrim(THISFORM.TEXT1.VALUE))  .and. cod=1
>if found()
>thisform.grid2.refresh
>THISFORM.GRID2.VISIBLE=.t.
>else
>THISFORM.GRID2.VISIBLE=.f.
>endif
>
>****3- at cmdPrintReport
>*****************************************
>local lnPK as Integer
>lnPk = trans1.no
>select * from trans1 where no = m.lnPK into cursor curToReport nofilter
>thisform.cmdPrintReport.SetFocus()
>report form rept2 Preview
>thisform.grid2.setfocus() && restore focus back
>
>thanks.
>
>m.qasem

I'm not sure, I understand the SET FILTER part. It doesn't seem right. Using ALLTRIM(NO) is no good and using filters with the grid is also not a very good idea. The last few lines of code should work, I hope. What exactly is not working?
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform