Subform 'losing' data

Matt Greatorex

Registered User.
Local time
Today, 09:01
Joined
Jun 22, 2005
Messages
1,019
I have a form and subform. Clicking a record in the subform displays the details of that record in the main form. The form is used for editing, adding and deleting data for a given person's sales record and the subform displays a full list of all records for that person.

When I edit a person's record, using the main form, and click on a button to run the code:

DoCmd.RunCommand acCmdSaveRecord

I can go into the underlying table and see the changes. I can also refresh the subform and see the changes.

However, the next time I click on any of the records in the subform, the value in one of the fields vanishes from both the subform and the table. Any other changes made, to however many fields, remain.

Surely, if there's a problem with that field, the update shouldn't happen at all?
 
Amendment

Further investigation has revealed that the value being lost each time is whichever is the oldest, rather than the one being added.

The sequence is:

1) Edit a record
2) Changes reflected in table
3) Changes reflected in subform
4) Another/the same item is selected in subform
5) On field from whichever is the oldest record gets cleared.
 
Your problem sounds interesting. If you email me a short version of your db, I would like to look into your problem.
 
Thanks for the response and the generous offer.

Luckily, I was able to track down the cause as a refresh being done elsewhere, for the main form. I commented out the line involved (which set a field to be "") and the problem stopped.

I have no idea why the problem was occurring - since no reference was being made to the underlying table - but at least it seems to be resolved.
 

Users who are viewing this thread

Back
Top Bottom