Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Making sure only one value is set in table
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Making sure only one value is set in table
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01493953
Message ID:
01493953
Views:
122
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
Next
Reply
Map
View

Click here to load this message in the networking platform