Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting items in a listbox that are linked to a view
Message
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Selecting items in a listbox that are linked to a view
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00969180
Message ID:
00969180
Vues:
50
Hello,

I have a listbox linked(control source) to a view which is a child view. The values getting populated in the listbox are stored in a lookup table and i'm doing this by seting the rowsource to fields in a lookup table, and the rowsource to fields. How do I get the items in the listbox to appear highlighted with the values that are in the view? The view contains two records, so I would like two separate items in the listbox to appear highlighted. Below is the code i'm using.

lvCorrType is the child view i'm describing above. I'm looping through the items in the listbox and checking to see if the current list item is equal to the value in my view. I'm selecting that item in the listbox if they're equal. I placed this code in the page activate event. The funny thing is the two items appear highlighted if I trace through the code in the activate event and whenever I navigate to another page on my form and then go back to the page where the listbox is. Is the listbox not getting refreshed? Any idea on how I can get this to work whenever the page first loads? Any help would be greatly appreciated. I'll gladly clarify anything. Regards, Bradley Deetz

SELECT lvCorrType
=REQUERY("lvCorrType")
FOR i = 1 to THISFORM.pgfCorrespondence.pagCorr.pgfCorr.pagCorrDoc.lstCorr.ListCount
IF lvCorrType.ccorrcode == ALLTRIM (THISFORM.pgfCorrespondence.pagCorr.pgfCorr.pagCorrDoc.lstCorr.List(i))
THISFORM.pgfCorrespondence.pagCorr.pgfCorr.pagCorrDoc.lstCorr.Selected[i] = .T.
SKIP + 1
IF EOF("lvCorrType")
EXIT
ENDIF
ENDIF
ENDFOR
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform