Search This Blog

Delete Code

This is delete code where you can delete a line or specific data from the table one at a time.

SELECT TableName
LOCATE FOR ALLTRIM(TableName.Allottee) = ALLTRIM(THISFORM.Text1.Value)
IF FOUND()
IF ALLTRIM(TableName.Allottee) = ALLTRIM(THISFORM.Text1.Value)
SELECT TableName
LOCATE FOR Allottee = ALLTRIM(THISFORM.Text1.Value)
SELECT TableName
USE
USE Allotments EXCLU
DELETE
PACK
=TABLEUPDATE(.T.)
ENDIF
ENDIF

Tag Code

Here is a sample of my tag code or tagging an amount .

lAnswer = MESSAGEBOX("Do you want to tag Journal Entry?", 4, "Confirmation")
IF lAnswer = 6
SELECT SviewJournalUpdate
LOCATE FOR IdNum = THISFORM.Text2.Value
IF FOUND()
REPLACE lDate WITH pJeDate
REPLACE RefDocu WITH pRefDocu
REPLACE JvNumber WITH THISFORM.TEXT10.Value
REPLACE LibUpdate WITH THISFORM.TEXT15.Value
THISFORM.Grid1.REFRESH
ENDIF
THISFORM.ActivityTag()
THISFORM.Release()
ENDIF

General Ledger FoxPro Folder

Whenever I make a FoxPro project folder I always make a folder for the Attach, Classlib, Data, Forms, Images, Menus, Progs and Reports. This  folder making will help me later on to separate the files that will be created. 

Form Init Code

Here is a sample of my code in Init of a Form.

SET DELETED ON
SET TALK OFF
PUBLIC pCurrUser
THISFORM.Text9.VALUE = DATE()
THISFORM.BeginBalance()
THISFORM.PettyDisable()
THISFORM.Grid1.Enabled = .F.

DO CASE
CASE ALLTRIM(pCurrUser) = "Admin"
THISFORM.Grid1.Enabled = .T.
THISFORM.cmdApprove.Enabled = .T.
CASE ALLTRIM(pCurrUser) = "User"
THISFORM.Grid1.Enabled = .T.
THISFORM.cmdApprove.Enabled = .T.
ENDCASE