Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ControlSource of an OptionGroup
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00522872
Message ID:
00523958
Views:
18
>>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 && Means we want to add
   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.

The second problem is that my RegionID updates like 4 6 8 10 and sometimes in strange reverse order.

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.

May be you can suggest some way around these two problems?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform