Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListBoxes and Parameterized Queries
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00208838
Message ID:
00208864
Vues:
20
Brian,
P-views can be very sensitive. Open you view in the view designer and check that the filter has no quotes and no spaces. It must be ?lnLotNum

Try deleting it and re-entering the filter carefully.

Then try the view hand-entering a number or 2 to check. Otherwise your code works exactly as you expect it to - I tried it out and each choice updated the second lis box.

HTH
Barbara

>Hi -
>
>I'm having a little trouble with listboxes. Can anyone help?
>
>Scenario: (VFP 5.0a)
>We have 20 lots of land, each given a name, and a number from 1 to 20.
>Each lot of land is divided into 100 blocks - each block is given a unique id.
>
>The tables storing this info. have the following fields:
> 1) tblLots
> nLot_number
> cLot_name
> 2) tblBlocks
> nLot_number
> cBlock_id
>
>What I've been trying to implement into a search form (frmSearch) is:
>
>a) one list box (lstLots) contains the list of lot names and lot numbers. I used the builder to help me create lstLots. It has two columns, (1) nLot_number and (2) cLot_name. lstLots is bound to column 1.
>
>b) another list box (lstBlocks) that is updated to show the
>corresponding blocks that fall within the lot number selected from
>lstLots. ie. if a user selects lot 14 in lstLots, I'd like lstBlocks
>to show all the blocks belonging in lot 14.
>
>I created a p-view (viewblocks) on tblBlocks that had the filter: tblBlocks.nLot_number = ?lnLotNum
>I added tblLots and viewblocks to the dataenvironment of frmSearch.
> ( viewblocks has its NoDataOnLoad property set to .T. )
>I changed the rowsource for lstBlocks to be viewblocks and the rowsourcetype to be alias. In the InteractiveChange event of lstLots I placed the following code:
>
>******
>LOCAL lnLotNum
>lnLotNum = this.value
>
>= requery("viewblocks")
>
> With This.Parent.lstBlocks
>  .Requery
>  .Refresh
> Endwith
>******
>
>When I run the form and select a lot number from lstLots, lstBlocks doesn't update. I think I'm missing something blatantly obvious either in my code or my setup. Any help or re-directions would be greatly appreciated.
>
>Thank You
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform