Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hey boy DonT repeat!!
Message
 
À
25/07/1998 19:01:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00121410
Message ID:
00121411
Vues:
14
>hi all
>
>i have a fomr with a grid and a button
>
>the source of the grid its a table Rtable
> when the user click in the button it makes an append blank to the Rtable
>so the user introduce data in the fields using the grid..
>one of the fields.. (JField) most to be fill with a data that Never should be duplicated in the table
>
>How can i make to validate that the user (when write a data in Jfield and that data exist previusly in the table)
>can ve showed some message or wait window saying(maybe)" hey boy this data exist previusly !!! write ahother thing"
>
>:}
> thanks in advance.

Augusto,
The simplest way would be to have the table loaded a second time with another alias
USE RTable alias RTLookUp

Then you can search for the JField data the user enters and tell him if it's already there. The problem with this approach is that 2 Users can enter the same data at the same time because they will both be told that the data is unused.

You can add a Primary or Candidate index on the JField, so that the data would be trapped by VFP when you save it. For this to work, however, you'd have to trap the Trigger Error and handle that in code.

Finally, do you need to have the users enter this information? Most developers find it best to use a "surrogate key" for their primary key field. This is a field that the users never see which is filled with a number guaranteed to be unique. Usually with either sys(2015) or a lookup table.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform