Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating format of field before searching
Message
De
24/08/2005 10:27:52
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01043304
Message ID:
01043334
Vues:
14
>I have a form which has a textbox which allows the user to search for a record in a table. The field and table they are searching on is padded by zeros. For example:
>
>00000001
>00001234
>0000000000789
>
>How can I set my field up so that the user can search by typing in 1 or 1234 or 789 and the correct record will still be found. The field length of the field in the table is 10. So I would need to somehow pad the number they type in so it is 10 characters.

Search for:
padl(ThisForm.TxtSearch.Value, 10, "0")
> Ideally though when the user types in 1234 I want the field to auto update in the form to 0000001234 before they search.

You could intercept the KeyPress() Event and change the .Value. Or just change it in the LostFocus() Event.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform