Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
String question on search screen
Message
De
20/06/1998 06:14:07
 
 
À
19/06/1998 15:01:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00110033
Message ID:
00110176
Vues:
21
>Hello:
>
>I'm working on a search screen that searches on various criteria
>and I'm getting an error when someone enters in an apostraphe
>in the surname i,e, O'leary
>
>How can I force then either not to enter the apostraphe
>or if they do give them an error message.
>
>I'm using the following code:
>
>str3=""
>
>If not empty(this.value)
>str3 = "upper(client.surname) like '" + allt(upper(this.value)) + "%'"
>Endif
>
>If left(str3,2) = "'"
>=messagebox("you cannot enter an apostraphe, please enter the first letter of last name", 48, "CATS")
>
>Any help would be appreciated.
> Thank you.

IF "'" $ client.surname

should detect any occurance of the apostrophe in the field.
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