Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo box to scroll thru a database
Message
From
24/03/2010 09:09:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/03/2010 08:56:13
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01456119
Message ID:
01456903
Views:
35
>>(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()
>
>Is there another way to do this?because i made a new form added 1 combo box and 1 field
>i populate my combo with my SQL and on valid /inint change i hav
>
>=seek(test.private,'test','prvate')
>thisform.refresh()
>
>
>the text box has a control source of the field from the table also i set bound to to true.
>even if i change the combo value..the text box doesnt change :(
>
>
>the SQL 2 populate my combo should be in the form init as well?

Ken,
I am having a hard time to understand you. Of course there are other ways to do that, in VFP as they say, there are at least three ways to do something. I provided the one which I think is the simplest and most reliable.

You should have it in interactivechange or valid, not both. I don't remember I said set bound to .t. somewhere. The sample I gave had nothing to do with binding. Textbox' controlsource is independant of combo's controlsource and it is a simple refresh once the record pointer is moved in the target table. However in your sample it looks weird:
=seek(test.private,'test','prvate')
Searching the value in itself??? It should look like:
=seek(comboCursor.private,'test','prvate')
I don't know what is SQL's cursorname is norif test refers to real table or not. Check the sample code I sent.

I don't understand, what is "SQL 2"? You populate the combo with a plain SQL in init or by setting its RowSource property in PEM sheet.

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform