>I have a view/input form populated by SPT code. When the form displays an index is created on the last name field and that order is set. I scroll to the record I need to edit. I run SPT edit code on my updateable fields. I issue the Use command and close tables. I then issue code to Use the original table again so my form fields can get the proper data. However, the record on the form and the record with the pointer in the table are not the same. If I refresh the form it displays the first record in the table. How can I get back to the record I originally was editing? I have a primary field that holds the user ID. This is what my SPT updateable code uses.
Two different ways:
1) If you have a PK, you can capture it's value at update and then locate it again on reload. That may be the simplest way.
2) You can avoid the issue by making the cursor updatable. It takes some work as you need to set the following via CURSORSETPROP: KeyFieldList, SendUpdates, UpdatableFieldList, UpdateNameList.
Do you really need to build an index? It might be better to add an ORDER BY clause to the SPT string.
Just some quick ideas.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.