Link to home
Start Free TrialLog in
Avatar of SowleMan
SowleManFlag for United States of America

asked on

Using DAO, why does .edit of a record make it disappear?

In the attached VBA code, I don't understand what is happening. I seek a record (successfully) and then go into .edit mode, move correct data into the  .fields, then .update the record being updated - and then the record disappears!!  When I query after running this code, the original record (the one found using .seek), is gone. The .add branch of the "if .nomatch" clause executes perfectly.

This code is in a form's BeforeUpdate event.

Any ideas?

Thanks.

Steve
Seek-followed-by-edit-and-update.txt
SOLUTION
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of SowleMan

ASKER

Joe Anderson's answer was the most influential.  Joe suggested that I might be using BeforeUpdate inappropriately. That comment made  me rethink my whole design for that form and I am going to try to rewrite it using much less VBA. I programmed for a living decades ago using COBOL, and I designed this form using old design principles.  

Thanks to Mr. Coachman - you gave my problem serious thought.

Steve