Hi!
I've been in that situation too, I didn't know there was a GetNextKey procedure.
Yet there are other ways to work around Primary Keys, -I'm Not sure that They´re a any better than the GetNextKey Method, but at least they're easy to implement :) -
1. You can Use a Modal Form to get the User Key BEFORE you submit an Append Blankor Insert Into Command, so you can do a classif IF SEEK("WHATEVER") then return .f.
2. In the Valid Method use a SELECT (name_of_the_PK_field) FROM (name_of_TABLE) WHERE (name_of_the_PK_field) == THIS.VALUE, then a IF _TALLY > 0, you can return 0 with the respective MESSAGEBOX, and you're done.
I also recommend you that (JUST IN CASE YOU DIDN'T KNOW), to all your PKs in the right textbox of the index fields there is one field called FILTER, ALWAYS put a !DELETED(), filter to a PK, unless you want to have problems everyday with your users, if you dont, then you'll get problems with the PKS.
Hey, If anyone out there knows other way to handle deleted recs (please dont answer me BLANK 'EM FIRST!) PLEASE DON'T HOLD IT OUT!!!
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only