Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor cannot be modified error ????
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01281030
Message ID:
01281044
Views:
13
Ok never mind I figured out my problem.
Making a long story short, I'm actually dealing with 2 grids here and it was the downarrow on the first grid that was acutally causing the record pointer to change. Now I'm saving the record pointer and making sure I'm on the correct one before I do the REPLACE command....geeze what a headace!

>Interesting you should say that, because that's something I've tried. This is the code I have in the KeyPress() method of the textbox in the lookup grid:
>
>IF nKeyCode = 13 && User has hit enter key
> SELECT MyRemoteView
> llTableUpdate = TABLEUPDATE(.T., .T., 'MyRemoteView')
>
> IF llTableUpdate = .T.
> Replace MyRemoteView.myfieldname WITH MyLookupRemoteView.MyLookupFieldName
> ELSE
> lnYesNo = MESSAGEBOX('Tableupdate failed!', 16, 'Data update error!')
> ENDIF
>ENDIF
>
>...what's strange is that the tableupdate worked, but yet I still get the error on the REPLACE command. The idea is once the user hits ENTER in this cell of the grid, the grid then disappears and that value is placed on my form. Basicly I'm making a glorified combobox..haha
>
>
>
>>You have to do TABLEUPDATE() after changing values.
>>
>>>I'm getting this error:
>>>Cursor cannot be modified because it contains an unsaved record (Error 2072)
>>>
>>>...when I try to do something like this:
>>>
>>>Replace myremoteview.myfield WITH This.Value
>>>
>>>
>>>This.Value is a textbox in a grid. What's odd is that the help says this:
>>>"...This error typically occurs when a record in a cursor is modified in a grid or Browse window and is not saved before moving to another record.
>>>Any code that modifies the cursor should ensure that all modifications are saved before moving the record pointer...."
>>>
>>>-which is exactly what's happening, I'm changing the value of a remoteview in a grid, then moving to the next recrod without saving it..
>>>
>>>...but I have my view setup with optimistic table buffering -- I thought that was supposed to LET me do this??
>>>
>>>Is there a way around this that anyone knows? Did I miss something with optimistic table buffering or something?
>>>
>>>Thanks!
ICQ 10556 (ya), 254117
Previous
Reply
Map
View

Click here to load this message in the networking platform