Search This Blog

Log Out Code

PUBLIC pCurrUser
SELECT SviewAccess
=REQUERY("SviewAccess")
LOCATE FOR ALLTRIM(UserName) = ALLTRIM(pCurrUser)
IF FOUND()
REPLACE AccessStatus WITH "LOGOUT"
THISFORM.REFRESH
ENDIF

CLEAR EVENTS
ON ShutDown
QUIT

Journal Entries on Journal Form

Upon clicking the grid a new form will appear where you can add information. It will also retain information from previous form such as Journal Number, Reference Documents and Particular.

PUBLIC pJournalNo, pJeNum, pRefDocu, pPart
IF !EMPTY(THISFORM.Text5.VALUE)
IF !EMPTY(THISFORM.Text7.VALUE)
THISFORM.Cs_Branches()
pJournalNo = THISFORM.Text5.VALUE
pJeNum = INT(THISFORM.Text7.VALUE)
pRefDocu = THISFORM.Text8.VALUE
pPart = THISFORM.Text1.VALUE
DO FORM "C:\GenLed\Forms\JournalForm"
ELSE
pJournalNo = THISFORM.Text5.VALUE
pRefDocu = THISFORM.Text8.VALUE
pPart = THISFORM.Text1.VALUE
pJeNum = ""
DO FORM "C:\GenLed\Forms\JournalForm"
ENDIF
ELSE
=MESSAGEBOX("Select a Journal Number", "Confirmation")
ENDIF
THISFORM.Grid1.Refresh

SQL Connections

Using SQL Server, you will need a connection string to be able to access the database. Here is the basic connection string format.

DRIVER=sql server;SERVER=ServerName;UID=UserName;PWD=Password;APP=Microsoft Visual;WSID=PcName;DATABASE=DatabaseName

Do not forget to verify connection.

Add Image on FoxPro Background

Are you bored on all white background of your FoxPro Program? Now you can pick or put a background image on your program. Just include this line of code on your main program and specify the locatin of the image.

_screen.picture = "C:\GenLed\Images\background.bmp"