Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How do I refresh my combo to see a newly appended record
Message
From
14/08/1999 22:05:34
 
 
To
14/08/1999 21:31:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253805
Message ID:
00253810
Views:
18
Hi, again, David-
>I want to force a combolist to refresh with the correct value when a command button appends a new record to a table buffered cursor.
...snip
>In the debugger I notice that the requery does not increase the length of the list...a bad sign and the obvious reason that setting listitemid to 1 doesn't o what I was trying to do.


These durned combos, eh? :-)

If a user types something new into a combo control, then YOU are in charge of adding the new value to the combolist and underlying rowsource, too. It's not automatic.

I've always done it in the VALID. Here's an example:
*~~ 01.15.99 nf 1: Added  .AND. ASC( this.displayvalue ) > 30 to beat the erroneous entry of a non-printable character when
*~~				   the list is closed via the down arrow.
IF TRIM(this.value) <> TRIM(this.displayValue) .AND. !EMPTY( this.displayValue ) .AND. ASC( this.displayvalue ) >= 30
	*!* Then we have a new value to add to the list
	this.additem( this.displayValue )
	
	REPLACE ( SUBSTR( this.controlSource, AT( '.', this.controlSource ) + 1 ) ) WITH this.DisplayValue IN ;
	        ( SUBSTR( this.controlSource, 1, AT( '.', this.controlSource ) - 1 ) )
ELSE
	RETURN .T.
ENDIF
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform