Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unbinding a dbf from a listbox
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00059324
Message ID:
00060027
Vues:
36
>Jim, the () after .requery is illegal so I omitted it.
>my code looks like this in the click section:
>
>THATOFF=THISFORM.MYLISTBOX2.VALUE
>With Thisform.myListbox2
> .RowSourceType=2
> .RowSource=""
> .rowsource= ""
> .Requery
>Endwith
>
>copy stru to c:\query && should be unbound but....
>sele select(0)
>use c:\query
>TMETH=thisform.mylistbox1.value
>thing=allt(thisform.mytextbox1.value)
>appe from M:&THATOFF for thing $ &TMETH
>
>
>
>NOW on the tmeth line it bombs out with the message
>"record is out of range" HELP!
Timothy,

The parens on the requery are legal, it is a method. If you got an error on that line something is wrong.

What is the rowsource for ListBox1? It appears that referring to listbox1's value is causing the lsit to try and access a record in its rowsource that is no longer in that rowsource.

This may help you out here. Changing the record in a lists rowsource does NOT update the internal list that the contorl maintains. You must call the control's requery method to do that. You can think of it this way;

You hire a new person tow ork for you (the listbox). You hand that person a paper with their job responsibilities written on it (the rowsource). Now they read the paper and memorize their resopnsibilities (the internal list of the listbox or combo). Now time goes by and you decide that you need to alter their responsibilities, so you change the paper list (the rowsource). You do not tell them this, and they do not do the new things. This is because they never reread the paper to update their memory. You relize this and so you call them on the phone and tell them that the paper list has changed (call the requery of the listbox or combobox) so they update their memory (the internal list in the control). You now know that whenever you change the paper list you must tell the employee that you did this so they can reread the paper. The same is true for listboxes and combos, whenever you change thier rowsource you must call their requery so they will change their internal list.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform