Search This Blog

Cancel Close Code



If you want your button's picture to change when your Close/Cancel button also changed.

IF THIS.Picture = "c:\SalesMarket\Images\close.jpg"
THISFORM.Release()
ELSE
THIS.Picture = "c:\SalesMarket\Images\close.jpg"
THISFORM.ReadOnlyTrue()
THISFORM.Combo1.Enabled = .F.
THISFORM.cmdPrint.Enabled = .T.
THISFORM.cmdEdit.Enabled = .T.
THISFORM.cmdEdit.Picture = "c:\SalesMarket\Images\edit.jpg"
ENDIF

Local View and Remote View

Samples of Local View and Remote View with different filter using like, between and =.

SELECT SviewAccountChart
lAccountCode = ALLTRIM(THISFORM.Text16.Value)+"%"
=REQUERY("SviewAccountChart")

SELECT SviewJvHeader
lJvNo = ALLTRIM(THISFORM.Text20.Value)+"%"
lJvBranch = ALLTRIM(THISFORM.Text21.Value)+"%"
=REQUERY("SviewJvHeader")

SELECT SviewCheckIssueReg
lCheckNum = ALLTRIM(THISFORM.Text20.Value)+"%"
lCheckType = ALLTRIM(THISFORM.Combo3.Value)+"%"
StartDate = THISFORM.Text14.Value
EndDate = THISFORM.Text15.Value
=REQUERY("SviewCheckIssueReg")

Opening a PDF File

You can open a PDF file in VFP b using below codes. Just specify the location of your PDF file on cFileName

DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
cFileName = "c:\GenLed\Images\CC.pdf"
cAction = "open"
ShellExecute(0,cAction,cFileName,"","",1)

Close or Exit Code

Sometimes when you tried to exit or close the program but unsuccessfully close. Try below codes. This is due to the READ EVENTS that sre still running so you need to CLEAR EVENTS then QUIT.

CLEAR EVENTS
QUIT