General information
Category:
Object Oriented Programming
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only