Article ID: 132331
Article Last Modified on 2/15/2000
PUBLIC oForm
oForm = CREATEOBJECT('myform')
oForm.SHOW
DEFINE CLASS mytextbox AS textbox
SpecialEffect = 1
BorderStyle = 0
FontBold = .F.
PROCEDURE keypress
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 48
REPLACE testnull.name WITH .NULL.
This.Value = ".NULL."
NODEFAULT
ENDIF
ENDPROC
ENDDEFINE
DEFINE CLASS mytextbox1 AS mytextbox
ControlSource = "testnull.name"
ENDDEFINE
DEFINE CLASS mytextbox2 AS mytextbox
ControlSource = "This.Value"
Value = ".NULL."
PROCEDURE gotfocus
This.Value = ".NULL."
ENDPROC
PROCEDURE lostfocus
IF This.Value <> ".NULL."
REPLACE testnull.name WITH This.Value
ENDIF
ENDPROC
ENDDEFINE
DEFINE CLASS mycolumn AS column
DynamicCurrentControl = "IIF(ISNULL(testnull.name),'text2', 'text1')"
Sparse = .f.
Bound = .f.
ADD OBJECT text1 AS mytextbox1
ADD OBJECT text2 AS mytextbox2
ENDDEFINE
DEFINE CLASS mygrid AS grid
RecordSource = ALIAS()
ADD OBJECT c1 AS mycolumn
ENDDEFINE
DEFINE CLASS myform AS form
ADD OBJECT g1 AS mygrid
PROCEDURE load
DELETE FILE testnull.dbf
CREATE TABLE testnull (name c(10) NULL)
FOR cnt = 1 to 10
APPEND BLANK
REPLACE name WITH IIF(MOD(RAND()*100, 2) >=1, SYS(3), .NULL.)
ENDFOR
GO TOP
ENDPROC
PROCEDURE unload
CLOSE DATA ALL
ENDPROC
ENDDEFINE
CREATE TABLE test (name C(10) NULL) APPEND BLANK REPLACE name WITH "Harry" APPEND BLANK REPLACE name WITH .NULL. BROWSEThe currently selected field has no text in it. Press the UP ARROW key or click in record 1. Record 2 now displays the ".NULL." text string.
Additional query words: VFoxWin browse
Keywords: KB132331