Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Primary Key generation
Message
From
14/03/1999 10:34:05
 
 
To
14/03/1999 09:17:38
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00197366
Message ID:
00197374
Views:
16
>Hello -
>
>When I am on a form and adding records to it, if I don't enter data into the form and click the add button again, the record counter goes to the next number and skips as many numbers as I press the add button.
>
>Example:
>For record #1 I enter data into the form
>For record #2 I enter data inot the form
>For record #3 I hit the add button and don't enter data
>
>If I hit the add button 2 more times, the primary key number is now up to #5. Let's say I add records to number 5.
>
>OK, now I go back to my associated table and look inside it, and it has the following:
>
>1 all data
>2 all data
>5 all data
>
>** record 2 and 3 don't exist.
>
>
>
>Is there a line of code I can use that would prevent this? Is so, where would I put it? Would I put it in my GetKey program?
>
>I would like to have the form/table recognize I am at the last form with data and not let me go past that form w/o putting data into it so I can keep things "tight"
>
>Thanks
>
>jason

Don't worry about it. If you later go back and delete record 2, you'd have the same problem. Because primary keys are hidden (or should be) from the user, you shouldn't worry about this.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform