>>PUBLIC oform1 >> >>oform1=NEWOBJECT("form1") >>oform1.Show >>RETURN >> >> >> ************************************************** >>*-- Form: form1 (c:\program files\microsoft visual foxpro 9\cbx.scx) >>* >>DEFINE CLASS form1 AS form >> >> >> DoCreate = .T. >> Caption = "Form1" >> Name = "Form1" >> >> >> ADD OBJECT combo1 AS combobox WITH ; >> RowSourceType = 3, ; >> Height = 24, ; >> IncrementalSearch = .T., ; >> Left = 24, ; >> Top = 24, ; >> Width = 264, ; >> Name = "Combo1" >> >> >> PROCEDURE combo1.KeyPress >> LPARAMETERS nKeyCode, nShiftAltCtrl >> >> *-- make sure the key stroke get there first. >> DODEFAULT( nKeyCode, nShiftAltCtrl) >> NODEFAULT >> >> DO CASE >> CASE LEN(ALLTRIM(this.DisplayValue))<3 >> *-- clear set >> this.RowSource="" >> >> case LEN(ALLTRIM(this.DisplayValue))=3 >> *-- generate new sub-set >> this.RowSourceType= 3 && SQL >> this.RowSource="Select Name from Customer where upper(LEFT(name,3))='" + ALLTRIM(this.DisplayValue)+"' and not DELETED() order by Name INTO CURSOR qtemp" >> >> OTHERWISE >> *-- keep current set >> ENDcase >> >> >> ENDPROC >> >> >>ENDDEFINE >>* >>*-- EndDefine: form1 >>************************************************** >>>>
>>>*!* *Create data for the patient Name combobox >>>SELECT DISTINCT ptnt_name FROM regtrans WHERE DELETED() = .F. INTO CURSOR csr_names ORDER BY ptnt_name >>>>>>
>>>CONTROLSOURCE csr_names >>>ROWSOURCE csr_names.ptnt_name >>>ROWSOURCETYPE 2 - ALIAS >>>VALUE "" >>>>>>