Login requirement needs changing password for security reason. Here is a sample change of password for FoxPro.
IF ALLTRIM(THISFORM.Text4.Value) == ALLTRIM(THISFORM.Text4.Value)
REPLACE SviewAccess.Password WITH ALLTRIM(THISFORM.Text4.Value)
*WAIT WINDOW "Password has been changed." NOWAIT
=MESSAGEBOX("Password has been changed. This window will exit.", "Information")
THISFORM.Release()
ELSE
WAIT WINDOW "Confirm password does not match." NOWAIT
ENDIF
Search This Blog
General Ledger Prooflist
The Daily Transaction Prooflist Report shows all the information for individual journal entries or account chart that were inputted for a particular date. The report is used to verify accuracy and completeness on journal entries for a particular day prior to posting. The report can be generated by indicating the Reference Date and Branch.
Branch Setting
PUBLIC pBranchName
LOCATE FOR ALLTRIM(BranchName) = ALLTRIM(THISFORM.Combo1.Value)
pBranchName = ALLTRIM(BranchName)
= MESSAGEBOX("You select "+ALLTRIM(pBranchName)+" Office?", "Confirmation")
THISFORM.Release()
Release Block User Code
In any login code, aside from status login, logout, I also made use of block. A user has a status of block if his username and password dis not match thrice in a row. This will help in the security of accessing the program.
PUBLIC pBlockUser
IF !EMPTY(THISFORM.Text2.Value)
IF THISFORM.Text4.Value = "BLOCK"
pBlockUser = THISFORM.Text3.Value
lAnswer = MESSAGEBOX("Do you want to release "+ALLTRIM(pBlockUser)+"?", 4, "Confirmation")
IF lAnswer = 6
SELECT SviewAccess
LOCATE FOR IdNum = THISFORM.Text2.Value
IF FOUND()
REPLACE AccessStatus WITH "LOGOUT"
=MESSAGEBOX("Successfully release "+ALLTRIM(pBlockUser)+" .", "Confirmation")
THISFORM.Grid1.REFRESH
ENDIF
ENDIF
ELSE
=MESSAGEBOX("Select a Block User.", "Confirmation")
ENDIF
ELSE
=MESSAGEBOX("Select User.", "Confirmation")
ENDIF
Balance Code
This code will check if textbox 1 is equal to textbox 2. If the two quantities is not equal a messagebox 'Not balance.' will appear but continue printing if balance at all.
IF !EMPTY(THISFORM.Text3.Value)
IF (THISFORM.Text1.Value) = (THISFORM.Text2.Value)
REPORT FORM "C:\GenLed\Reports\ReportJournalEntry" TO PRINTER PROMPT NODIALOG PREVIEW
THISFORM.Refresh()
ELSE
=MESSAGEBOX("Not balance.", "Confirmation")
ENDIF
ELSE
=MESSAGEBOX("Choose Journal Entry.", "Confirmation")
ENDIF
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.)
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
Subscribe to:
Posts (Atom)