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
17/08/1999 21:30:20
 
 
To
14/08/1999 21:31:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00253805
Message ID:
00254775
Views:
16
>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.
>
>Here's some important particulars.
>
>mytable ordered on wonumber (not a unique key)
>buffering pess/table
>
>combo controlsource:none
> boundto: .f.
> rowsource: mytable.wono
>
>Here's my ineffectual attempt to synch to combolist display with the newly appended record. In the click of the commandbutton:
>
>append blank
>thisform.mycombo.requery
>thisform.mycombo.listitemid = 1
>go top
>set some record fields to default values
>thisform.refresh
>
>The above does put the table pointer at the right record (because of the go top), but what's displayed is the pre-append first wono in the list ... a value greater than 0 (which is what the value of wono is in the newly appended record).
>
>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 do what I was trying to do.
>
>So, how do you force feed a newly appended record into the combo so that the display is refreshed correctly. Or more generally, if I move a table pointer for a table that's rowsourced to a combo (but not controlsourced), how do I force the combo's displayed value to refresh correctly?




In gerenal case, combox with KeyField is needed to move the record pointer to
appointed record after interactivechange.

What I suggest is you're better to disable or hide the combox during append blank record until the new record is updated or tablerevert!

To show the combox with right value, you can code after finish add:

combox.visible=.T.
combox.rowsource=mytable.wono
combox.value=mytable.wono

^_^
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform