Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening combobox on the specific item
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01120459
Message ID:
01120475
Vues:
14
While I was waiting for the reply I implemented the exact same code, but I didn't have
this.Value = crsCmb2.Fld2 and it was not working. Let me try adding it.

He-he. And indeed it worked. I was so close to solving it myself <g>

>>Hi everybody,
>>
>>I have two comboboxes with Insurance Carriers. When I select an item in the first combobox and open the second combobox, I'd like to be positioned on the nearest item.
>>
>>Do you know how can I achieve this functionality?
>>
>>In other words, I only want to be positioned when I open the combobox. This combobox has a cursor as its source.
>>
>>Thanks in advance.
>
>Something like that?
>
>oForm = CREATEOBJECT([Form1])
>oForm.Show()
>READ EVENTS
>
>DEFINE CLASS form1 AS form
>
>
>	Top = 0
>	Left = 0
>	Height = 111
>	Width = 242
>	DoCreate = .T.
>	Name = "form1"
>
>
>	ADD OBJECT combo1 AS combobox WITH ;
>		Height = 24, ;
>		Left = 29, ;
>		Style = 2, ;
>		Top = 22, ;
>		Width = 179, ;
>		Name = "Combo1"
>
>
>	ADD OBJECT combo2 AS combobox WITH ;
>		Height = 24, ;
>		Left = 32, ;
>		Style = 2, ;
>		Top = 63, ;
>		Width = 176, ;
>		Name = "Combo2"
>
>
>	PROCEDURE Load
>		CREATE CURSOR crsCmb1 (Fld1 C(20), fld2 I)
>		CREATE CURSOR crsCmb2 (Fld1 C(20), fld2 I)
>		FOR asd = 1 TO 30
>		    INSERT INTO crsCmb1 VALUES ([Fld ]+TRANSFORM(asd),asd)
>		    IF asd % 2 == 0
>		       INSERT INTO crsCmb2 VALUES ([Fld ]+TRANSFORM(asd),asd)
>		    ENDIF
>		NEXT
>
>		SELECT crsCmb2
>		INDEX ON Fld2 TAG crsCmb2
>	ENDPROC
>
>
>	PROCEDURE Init
>		thisform.Combo1.RowSourceType = 6
>		thisform.Combo1.RowSource     = [crsCmb1.Fld1, Fld2]
>		thisform.Combo1.BoundColumn   = 2
>		thisform.Combo1.BoundTo       = .t.
>		thisform.Combo1.Value         = 0
>
>		thisform.Combo2.RowSourceType = 6
>		thisform.Combo2.RowSource     = [crsCmb2.Fld1, Fld2]
>		thisform.Combo2.BoundColumn   = 2
>		thisform.Combo2.BoundTo       = .t.
>		thisform.Combo2.Value         = 0
>	ENDPROC
>
>
>	PROCEDURE combo2.DropDown
>		IF thisform.Combo1.Value # 0
>		   SET NEAR ON
>		   SEEK thisform.Combo1.Value IN crsCmb2
>		   SET NEAR OFF
>		   this.Value = crsCmb2.Fld2
>		ENDIF
>	ENDPROC
>
>        PROCEDURE Destroy
>             CLEAR EVENTS
>        ENDIF
>
>ENDDEFINE
>
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform