Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Box not behaving the same as other
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01133388
Message ID:
01133408
Views:
12
This works for me:
PUBLIC oForm1
oform1=NEWOBJECT("form1")
oform1.Show
READ EVENTS

RETURN


*
DEFINE CLASS form1 AS form


    Top = 0
    Left = 0
    Height = 85
    Width = 186
    DoCreate = .T.
    Name = "Form1"


    ADD OBJECT combo1 AS combobox WITH ;
        BoundColumn = 2, ;
        Value = 0, ;
        Height = 24, ;
        Left = 25, ;
        Style = 2, ;
        Top = 13, ;
        Width = 136, ;
        BoundTo = .T., ;
        Name = "Combo1"


    ADD OBJECT text1 AS textbox WITH ;
        Alignment = 3, ;
        Value = 0, ;
        Height = 23, ;
        Left = 30, ;
        SelectOnEntry = .T., ;
        Top = 47, ;
        Width = 100, ;
        Name = "Text1"


    PROCEDURE Load
        CREATE CURSOR Test (Fld1 I, Fld2 C(20))
        FOR asd = 2 TO 20
            INSERT INTO Test VALUES (asd, [Test ]+TRANSFORM(asd))
        NEXT
        INDEX ON Fld1 TAG Test
        GO TOP
    ENDPROC


    PROCEDURE Init
        thisform.Combo1.RowSourceType = 6 
        thisform.Combo1.RowSource = [Test.Fld2, Fld1]
        thisform.Combo1.ColumnCount = 2
    ENDPROC


    PROCEDURE combo1.InteractiveChange
        thisform.Text1.Value = this.Value
    ENDPROC


    PROCEDURE text1.Valid
        IF NOT INDEXSEEK(INT(this.Value),.t.,[Test],[Test])
           MESSAGEBOX([aaaaaaaaaaa])
        ELSE
           thisform.Combo1.Value = INT(this.Value)
        ENDIF
    ENDPROC

    PROCEDURE Destroy
        CLEAR EVENTS
    ENDPROC

ENDDEFINE
Can you send me a simple form and data to see what happens?



>No difference at all, I'm afraid.
>
>Even the combo is doing the same, when select from the combo - just get blank selected combo. Very strange when the other works fine!!!
>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform