>>>George,
>>>
>>>Thanks for the reply.
>>>
>>>I do a TableRevert if the new record is blank because I must have something in some of the fields to save it to my tables.
>>>
>>>So I should be ok using APPEND BLANK.
>>
>>Nadya was doing an APPEND BLANK then a GATHER MEMVAR, thus the problem.
>
>Actually, I didn't do gather memvar, though I did APPEND BLANK originally (it's in our BaseForm class code of Add method). Now I had to create my own code in this particular form Add method. I found two other problems as well (had another thread about it, but this is a brief description of the problem found):
>
>My table had a default value for ID field lNextID('Regions'). In the form I use a p-view based on Regions table only (no other tables). In add method I put the following code (quoted by memory);
>
>if thisform.EditMode
> return dodefault()
>else
> select RegionsInfo
> lnRegionID=lNextID('Regions')
> insert into RegionsInfo (customerID, RegionID, ...) ;
> values (oJC.CustID, m.lnRegionID,..)
> ...
>endif
>...
>
>
>Now, the first strange thing is, that it picks up lNextID SP from the wrong database.
You mean a similarly named table in a different DBC? If so, it's sounds like the database you think is current isn't. Do you have stored procs with the same name?
>The second problem is that my RegionID updates like 4 6 8 10 and sometimes in strange reverse order.
I'm not sure that I understand this. Is RegionID a PK or a numeric regional indentifier that's used to associate a given area grouping?
>So, currently in order to solve both problems I renamed my SP to GetNext_ID (I have to change each table in DBC to call this procedure by its name, I didn't change for all tables yet) and I also removed default value from Regions table, though it doesn't seem right, because if I ever would need to edit this table directly, I would be unable to do it.
Again, I'm not sure what your doing. It's sounds like you're trying to retrieve a PK. If so, is the appropriate record being locked before you try to retrieve the value and then increment it?
George
Ubi caritas et amor, deus ibi est