Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Making sure only one value is set in table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Making sure only one value is set in table
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01493953
Message ID:
01493953
Vues:
125
OK, I don't know wether it is the holidays, and I shouldn't be working but...

I have a company table with branches in it. I have a field that states which branch is the primary... ie, it allows for each branch to be set as their own primary for information that is not shared to be accessed only by them. So I set up a sitedefa field, with a value of .T. if this is the primary branch.

Out of the seven sites, there can only be one primary, ie one record where sitedefa field is .T.

How do I ensure, if a user tries to chnage another site to be the default one, that
1. I let them know they are trying to do this.
2. Ask them to confirm it, if they do.
3. Do if they do want to, otherwise revert this field.

I wrote some code in the vlaid event of the defasite field on the form, however, it pops up with the error that the record is in use by another, when I am the only person using it.

Is there a simple way to get around this issue? I tried curval, oldval method, I tried buffering the value on start, etc.
Still get the annoying error above.

TIA,
Mike
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform