Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question: LOCATEing records
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00263556
Message ID:
00263608
Vues:
20
>Using VFP 5.0 I've got a form populated with various fields from a table. In a text box at the bottom of the form users can enter a part number (or partial part number) that needs to be located int he table. The table is indexed on the field being searched. Here is my code:
>
>If Thisform.opgSearchType.optPartNumb.Value = 1 Then
> LOCATE for Thisform.txtFind.Value $ fullpric.catno
> Thisform.Refresh()
>Endif
>
>1) Why does my LOCATE command not find the the catno being searched for?

LOCATE works in the context of the currently selected work area, although you can test a field of another table where a SET RELATION is in effect. If you're in a different table. If the field is in another table, and the record in the other table doesn't automatically move when the current table record changes, the LOCATE will see the same value each time, and fail.

SELECT fullpric before issuing the LOCATE might help...

>2) Will Thisform.Refresh() refresh my form to move the record pointer to recno()?

Unless you've added code to move the record pointer, it should just update the display values for controls from the current source; if you moved to a different record and a control refers to a field of the table that moved, the new value will be displayed.


>
>Sorry for the simplicity of this question, but I only use VFP a couple of times a year.
>
>TIA
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform