Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo box to scroll thru a database
Message
De
23/03/2010 08:33:55
 
 
À
23/03/2010 08:28:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01456119
Message ID:
01456432
Vues:
30
>(Assuming your table's name is myTable, primary key field name is pkField and index tag name is myPkTag)
>
>
select fieldA,fieldB, ..., pkField from myTable where intemtype="x" into cursor test
>
>InteractiveChange or Valid:
>
>
=seek(test.pkField, 'myTable', 'myPkTag')
>thisform.refresh()
>
>Do not use combo.value or such. Directly use test.fieldname. Here is a complete sample using testdata!customer:
>
>Public oForm
>oForm = Createobject('comboSample')
>oForm.Show
>
>Define Class comboSample As Form
>  DataSession = 2
>  Add Object t1 As TextBox With ;
>    top=10,Left=10,ControlSource='customer.cust_id'
>  Add Object t2 As TextBox With ;
>    top=40,Left=10,ControlSource='customer.Company'
>  Add Object t3 As TextBox With ;
>    top=70,Left=10,ControlSource='customer.Contact'
>
>  Add Object cmbSample As ComboBox With ;
>    top=100,Left=10,Width=200,;
>    Style = 2, ;
>    RowSourceType=3,;
>    RowSource='select Company, cust_id'+;
>    ' from (_samples+"data\customer")'+;
>    ' into cursor crsCustomers'
>
>  Procedure Load
>    Set Multilocks On
>    Use (_samples+'data\Customer')
>    CursorSetProp("Buffering",5,'Customer') && don't want to really save during testing
>  Endproc
>
>  Procedure cmbSample.InteractiveChange
>    =Seek(crsCustomers.Cust_id,'customer','cust_id')
>    This.Parent.Refresh()
>  Endproc
>Enddefine
>
>
>Cetin
ahh
seek(test.pkField, 'myTable', 'myPkTag')
thisform.refresh()
this works but twice lol
ill look at it some more
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform