Data Missing After Entry

M

mewins

I have a rather large database with a centralized back end and 2 different
front ends that 2 different departments use. Apparently some people are
entering data and then finding later that it is no longer in the database.
It seems to primarily happen with 1 of the front ends and less so with the
2nd. Staff run Access 2003 on either Windows XP or ME. No one staff member
seems to have any more problems than another, so it doesn't immediately seem
like one particular person/computer/time of day. There are probably less
than a dozen people using the database at any given time, and though staff
may be looking at the same record at the same time, it is probably less
frequent than the reports of data gone missing. Any ideas on what's going on
and how to fix this? Thanks
 
A

Allen Browne

If you are using the Close method to close forms, it could be this issue:
Losing data when you close a form
at:
http://allenbrowne.com/bug-01.html

If the data is disappearing from a subform, they may be entering a subform
record when the main form is at a new record. In this case, the foreign key
field will be null, so the record will never show up in the subform again
(even though it is in the table.)
 
M

mewins

Ok, this might be the issue. I have a close button that does:

Private Sub Close_Record_Click()
On Error GoTo Err_Close_Record_Click


DoCmd.Close

Exit_Close_Record_Click:
Exit Sub

Err_Close_Record_Click:
MsgBox Err.Description
Resume Exit_Close_Record_Click

End Sub

So if I add the:
If Me.Dirty Then
Me.Dirty = False
End If
DoCmd.Close acForm, Me.Name

command in my close button code, this should theoretically fix the problem?
 
A

Allen Browne

Yes: that will solve that particular issue, for the reasons outlined in the
article.

They will get an error message, and can then undo the record (pressing Esc)
or complete it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top