Form (with subform) will not show records

  • Thread starter Thread starter Gary B via AccessMonster.com
  • Start date Start date
G

Gary B via AccessMonster.com

I have a problem which is making me tear my hair out. Where I have a form
with a subform, occasionally after a design change, the form will only open
to a new record. Even if the fields are populated (on the parent and child
or any combination) the next time the form opens it will be to a new record
and will refuse to open to a specific record or show any old records. I have
tried deleting all records on the parent and child tables/queries to no
effect. The only way round it is to create a new form. In fact, what I do
now (to avoid unzipping and importing from the last backup) is to keep a
saved copy of all forms with a subform in the database, so that when the
problem hits again, I simply revert to the last copy. I've noticed that it
is more likely to happen if I have made changes to the subform and closed the
parent without saving the form, so that an Access dialogue asks me to save.
Obviously I try and remember to save the form before closing it, but
sometimes, in the heat of frenzied coding, I just forget. Any ideas would be
appreciated.

This happens to me in XP and 2003.

Thanks.
 
Firstly Gary, is there any chance that the form's DataEntry property is
being set to Yes? That would explain it.

If that is not the case, it is possible that the form is corrupting. Are you
modifying the code while the form is open (i.e. not in design view?) That
can corrupt it. Is Name AutoCorrect on? Are you editing in both versions?
(If so, you need to decompile, particularly before switching back to the
lower version.)

For more general suggestions, see:
Preventing Corruption
at:
http://allenbrowne.com/ser-25.html

I presume we are not talking about Access actually crashing here (shut down
by Windows.) That can be caused by a subform where the field named in
LinkChildFields is not represented by a control in the subform.
 
Hi Allen,

Thanks for your reply. To be honest, I wasn't actually expecting one, so
even if you hadn't been able to help I would have been pleased.

Anyway, you have given me a few pointers which I will adopt as of now.
DataEntry wasn't set to Yes, however:

I HAVE been changing code with the form open. I DID have Name Autocorrect on
(although I would swear that I'd turned it off). My problems, I think, are
all answered in your excellent article. I have had problems with Access
crashing and again, it is always with subforms, so I'll try your suggestions.
All in all, you've answered my question quite thoroughly, for which I thank
you very much.

Kind regards,

Gary Beale

Allen said:
Firstly Gary, is there any chance that the form's DataEntry property is
being set to Yes? That would explain it.

If that is not the case, it is possible that the form is corrupting. Are you
modifying the code while the form is open (i.e. not in design view?) That
can corrupt it. Is Name AutoCorrect on? Are you editing in both versions?
(If so, you need to decompile, particularly before switching back to the
lower version.)

For more general suggestions, see:
Preventing Corruption
at:
http://allenbrowne.com/ser-25.html

I presume we are not talking about Access actually crashing here (shut down
by Windows.) That can be caused by a subform where the field named in
LinkChildFields is not represented by a control in the subform.
I have a problem which is making me tear my hair out. Where I have a form
with a subform, occasionally after a design change, the form will only
[quoted text clipped - 22 lines]
This happens to me in XP and 2003.
 
Back
Top