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
15/08/1999 13:14:17
 
 
To
14/08/1999 22:05:34
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253805
Message ID:
00253868
Views:
20
Thanks again for your help with the Combo Blues.

I got the Combo Blues, they say that's old news
I got the Combo Blues, they say that's old news
Old news or new, that combo's got me blue
'n that's why I'm callin on you....i got the combo blues


But...

I'm not sure the snippet below is what I'm looking for. In my case, the user clicks a commandbutton to add a work order. In the click of the command button I have an APPEND BLANK. Now I understand that the combolist (same one we've talked about before) won't magically update to match the table ... but I thought that's what requery was for??? to force VFP to rebuild the combolist???

By the way. Even though my explicit requery after the append fails to rebuild the list, subsquently clicking on the combolist apparently does cause it to be rebuilt automatically, because the new value (a blank) does appear and the combo listcount has increased by 1.

It's important to note that I am only using the combolist to navigate the table, not to specify new values for the table field I'm using to navigate with. So controlsource is set to 'None'. I'm not sure how your snippet will work in this case, and, if I understand your snippet correctly, it doesn't apply to what I'm trying to do.

>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
"The Iron Fish: The water is cold...but the fish don't mind"
...Jay Jenks, boyhood chum
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform