Search This Blog

Disable Code

How to disable command button, text box, combo box, grid and pageframe:


Thisform.Command1.Enabled = .F.
Thisform.Text1.Enabled = .F.
Thisform.Combo1.Enabled = .F.
Thisform.Grid1Enabled = .F.
Thisform.Pageframe1.Enabled = .F.

FoxPro Graph

To those who are neophyte in VFP Language might have a hard time researching and building a graph in a form and report. I also had a hard time making a graph when I first encountered a VFP Project with a graph. But once you learned, it is easy for the next project to bulid a graph in form and report.

You need the following requirements before continuing to the graph:
Table
OleGraph
Grid

SELECT * FROM crewquestion INTO CURSOR MYCURSOR
TAB = CHR(09)
CRLF = CHR(13) + CHR(10)
SELECT MYCURSOR
NEWDATA = TAB + "Recruitment & Selection" + TAB + "Documentation" + TAB ;
+ "In House Training" + TAB + "Accounting Activity" + TAB + "Working Gears" + ;
CRLF
SCAN
NEWDATA = NEWDATA + TAB + STR(question1) + TAB + STR(question2) + TAB ;
+ STR(question3) + TAB + STR(question4) + TAB + STR(question5) + ;
CRLF
ENDSCAN
SELECT crewquestion
APPEND GENERAL crewques1.Olegraph DATA NEWDATA
SELECT crewquestion
THISFORM.REFRESH

SELECT * FROM crewquestion INTO CURSOR MYCURSOR
TAB = CHR(09)
CRLF = CHR(13) + CHR(10)
SELECT MYCURSOR
NEWDATA = TAB + "Padala Sytem" + TAB + "Company Facilities" + TAB + "Attitude of Staff" + TAB ;
+ "P&I Medical Assistance" + CRLF
SCAN
NEWDATA = NEWDATA + TAB + STR(question6a) + TAB + STR(question6b) + TAB + STR(question6c) + TAB ;
+ STR(question6d) + CRLF
ENDSCAN
SELECT crewquestion
APPEND GENERAL crewques2.Olegraph DATA NEWDATA
SELECT crewquestion
THISFORM.REFRESH

Back Color

Changing the back color of an Edit Box. Same applies to Text Box, Combo Box or Grid.

THISFORM.TEXT1.BackColor = RGB(255,255,255)
THISFORM.EDIT1.BackColor = RGB(255,255,255)
THISFORM.EDIT2.BackColor = RGB(255,255,255)
THISFORM.EDIT3.BackColor = RGB(255,255,255)
THISFORM.EDIT4.BackColor = RGB(255,255,255)
THISFORM.EDIT5.BackColor = RGB(255,255,255)
THISFORM.EDIT6.BackColor = RGB(255,255,255)
THISFORM.EDIT7.BackColor = RGB(255,255,255)
THISFORM.EDIT8.BackColor = RGB(255,255,255)

Empty Box

This code lets you use an Edit Box and will saved "Y" if the edit box is not empty otherwise save "N" if the edit box is blank. This is useful if you need to show in a View what Edit Box has an input and will not include blank.

SELECT QuestionTable
REPLACE q1comment WITH THISFORM.EDIT1.Value
IF EMPTY(THISFORM.EDIT1.Value)
REPLACE Q1Indicator WITH "N"
ELSE
REPLACE Q1Indicator WITH "Y"
ENDIF