Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Boxes
Message
From
16/10/2001 14:38:03
 
 
To
16/10/2001 10:33:02
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00569018
Message ID:
00569191
Views:
21
Hi Tom.

>I'm trying to tie the same combo box to different data sources programmatically. Sort of a reusable combo box. Different actions make the combo box do different things. Here's what I've tried:
>
>1 thisform.cmbTemp.Style = 2
>2 thisform.cmbTemp.RowSourceType = 6
>->3 thisform.cmbTemp.ControlSource = queries.name
>4 thisform.cmbTemp.RowSource = name
>5 thisform.cmbTemp.visible = .t.
>
>The table is 'queries' and the field is 'name'. I'm simply trying to list all of the names in the combo box. Queries is an alias that is open at the time of instantiation.
>
With a RowSource type of 6-Fields, you want the RowSource to be

thisform.cmbTemp.RowSource = "Queries.name"

However, you do not want to set the ControlSource to be the same as the RowSource because it will cause you nothing but problems. Typically a combo box is used to relate the descriptive text in some lookup table (used as the combo's RowSource) to a Foreign key that is stored in a different table.

You say that all you want to do is list all of the names in the combo box. Why? So the user can pick a query and then run it? If this is the case, you probably want to leave the combo's ControlSource blank.

HTH.
Previous
Reply
Map
View

Click here to load this message in the networking platform