Access this solution immediately by signing up as a member of FoxproAnswers.com--it’s quick, easy, and secure. We will return you to this solution, unlocked, when you’re done.
I've got a problem where APPEND seems to get confused.
What I'm trying to do is to add a new record by copying information from an existing one, and then editing the new one - but VFP edits the old on.
I've got a FORM (QWNAMES) which displays the contents of a file as a grid object. I can move around in this happily.
I've got some buttons at the top of the FORM. One of these [Edit], allows me to edit the 'current' record. This calls another FORM (QWNAMEG) to do the actual editing. All of which works fine.
I've also got a button [Insert], which has a little drop-down shortcut, offering 'Blank' or 'Copy'. If you select 'Blank', then the method code does
APPEND BLANK
DO FORM qwnameg
so as to add a new blank record, and then edit the contents of that using the editing FORM.
What I want to have happen with 'Copy' is for the existing record to be replicated, and then edit the contents of the new record. The code for this is
SCATTER MEMO TO MEMVAR
APPEND BLANK
GATHER MEMO FROM MEMVAR
DO FORM qwnameg
For some reason, this doesn't work (or at least, doesn't work in the way that I'm expecting it to!).
From the status bar at the bottom of the VFP window, I can see that record 10490 is highlighted (out of 10491).
If I click on my [Insert] button and select 'Copy' from the shortcut, then I get a new record (because the record-count goes up to 10492), but I'm editing the 'old' record, number 10490. If I make some changes, then these overwrite the 'old' record.
What is seriously weird about this is when I try running the debugger in order to trace what's happening - it works perfectly with debug mode!
Does anyone have any suggestions about what I'm doing wrong here?
I'm running VFP 9.0 SP2 on a machine that's running Vista Business SP2.
Access this solution immediately by signing up as a member of FoxproAnswers.com--it’s quick, easy, and secure. We will return you to this solution, unlocked, when you’re done.
Posted on 2009-10-11 at 11:04:48ID: 26243793
All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.