Search This Blog

Showing posts with label requery. Show all posts
Showing posts with label requery. Show all posts

Table Update Code

Sample of table update implemented in replace:

SELECT SviewAccountList
lBranches = pBranchName
=REQUERY("SviewAccountList")
LOCATE FOR (IdNum) = (THISFORM.Text34.Value)
IF FOUND()
REPLACE TotalDebit WITH THISFORM.TEXT15.Value
REPLACE TotalCredit WITH THISFORM.TEXT18.Value
REPLACE EndingBalance WITH THISFORM.TEXT26.Value
REPLACE Lines WITH "POST"
REPLACE LDate WITH DATE()
=TABLEUPDATE(.T.)
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")

Export Code

Use this code when you want to export data from table to Excel File. Plus with a message box informing you if you want to do so. There is also a message box that telling you that you have successfully exported your table to an Excel File.

lAnswer = MESSAGEBOX("Generate Report, do you wish to continue?", 4, "Generator")
IF lAnswer = 6
SELECT SeafarerList
=REQUERY("SeafarerList")
COPY TO "C:\SEAFARER.XLS" XL5
=MESSAGEBOX("File successfully generated.", "Successful")
ENDIF