I have a small switchboard form that has three buttons on it. Each button opens a form. However, when I click on any of the buttons, the 2nd form is instantiated and jumps to the forefront but after instantiating itself it immediately runs the form's unload and releases the form. Focus is returned to the switchboard form and it is then the only form still available. Why would this happen?
Here is code in the command button:
PRIVATE llfound
llfound = .F.
FOR EACH loForm IN _VFP.FORMS
IF VARTYPE(loForm) = "O" AND pemstatus(loForm, "BaseClass", 5) AND loForm.BASECLASS = "Form" AND loForm.NAME != "Startup"
IF UPPER(loForm.NAME) = 'CPDF'
llfound = .T.
IF loForm.WindowState=1
loForm.LockScreen = .T.
loForm.WindowState = 0
loForm.LockScreen = .F.
ENDIF
loForm.refresh()
loForm.Show(loForm.WindowType)
ENDIF
ENDIF
ENDFOR
IF !llfound
DO FORM cpdf NAME ocpdf LINKED
ENDIF
.·*´¨)
.·`TCH
(..·*
010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"