Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combo Question
Message
From
31/03/2000 03:54:10
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00352936
Message ID:
00353205
Views:
17
Hi Phil.

>> I have a combo with incremental search on a form. In the interactive change event, I have this code: <<

As Barbara already told you, the Valid method is a better place for this code because it fires only when the user has actually selected something from the combo box. InteractiveChange fires on every keystroke.

>> l_cSeekDoc=.cbocode.VALUE
SELECT DOCUMENT
SEEK l_cSeekDoc
.txtrmrev.value=alltrim(DOCUMENT.revision)
.txtrmname.value=alltrim(DOCUMENT.TITLE)
This.value=l_cSeekDoc <<

How is your combo box set up? It look like it is unbound and is only being used for navigating the Document table. If this is the case, you can just set the combo up with a RowSourceType of 6-fields and set its RowSource to Document.l_cSeekDoc. If this is a numeric value, then you have to set the combo's BoundTo property to true. Then, whenever you make a selection in the combo, it will automatically move the record pointer in the Document table. So if txtrmrev and txtrmname are bound to the fields in the Document table, all you have to do id refresh them and they will display the appropriate value.

Just mu $.02 - doing it the way I just described means you can do it with less code. IMHO, less code means fewer bugs ;-)

Marcia
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform