This is a bit complicated. I have a tabular form “F_EditCard” which has as its recordsource table “Phases”. Each record in Phases has two text fields, Ph_Heading and Ph_ResponsePrompt. Both these fields are represented on the form F_EditCard and they can be updated. On the form there is a button “CancelChanges”, which when clicked runs a routine which first deletes all the records in Phases and then adds records back into the table which contain backup data, then does a Me.Requery. I have noticed that sometimes this routine generates a “Record Deleted” error and sometimes it doesn’t. It took me a long time to figure out the pattern.
The form F_EditCard has record selectors. Let’s say I am on record 3. When I put the cursor into the box corresponding to field Ph_Heading in record 3, and then change the text, the triangle on the record selector of record 3 changes to an icon which looks sort of like a yellow pencil. If I now click the CancelChanges button I get the error mentioned above. But .. if I first move the cursor away from record 3 to some other record and don’t change that other record the yellow pencil on the record selector of record 3 dissappears. Now I can push the CancelChanges button and the data reverts to the original and I don’t get the error. It would appear that if I don’t move the cursor away from a record I am editing, that record is in a sort of limbo state and if I try to delete it the system will not like it. What I would like to do is put into the code of Sub CancelChanges_Click() something that has the effect of telling the program “If a record is in the middle of being edited, accept the edits so far and get that record out of the edit mode”.
Any suggestions?
Thanks in advance