Subsheet Datasheet Miseries.

  • Thread starter Thread starter John S
  • Start date Start date
J

John S

Still at it. I have a subsheet bound to a temporary table. Unfortunately,
every time I load the form/subform the fields in the subform datasheet read
"#deleted# ". The underlying data is there, and appears when I take the
record in and out of design mode.

A newsgroup expert suggested setting the recordsource to "" before the
delete, and then resetting it after. Doesn't appear to work. I have moved
delete functions and query functions to different events in the form and
subform. No works. I tried deleting the table in the form that calls the
form/subform with the datasheet bound to the temporary table. Doesn't
eliminate the #deleted# problem.I have also tried various variations of
requery and refresh. Nada.

Surely someone has experienced the same problem, and figured a work around
(help!).

John S
Aylmer, PQ Canada
 
This normally happens because a form (or subform) is displaying a record,
but thwen, some other code running "behind the scenes" has deleted that
record.

So, do you have any code in your main form or subform that is deleting
records from the temporary table? If so, what does that code do immediately
afterwards, to get the subform to update its display accordingly?

HTH,
TC
 
Hi TC,

The first thing I do in the form load event on the main form is delete
everything from the temporary table, then I reload the main form and the
datasheet using ADO recordsets.

I have tried deleting from the prior form (the one calling the main
for/subform combination), I have tried requery from the main form (though
here I have had problems referencing the subform), and requering from the
sub form itself. I Assumed the main form loads first, I tried loading the
subform from its form load event -- no go. Now, I suspect that the subform
loads first.

One thing I know for sure is that it is caused by the delete: if I remove
the delete, it works perfectly except (of course) the records keep doubling.

I suspect that that this has something to do with timing and events
relating to forms / subforms.

Any thoughts?

John S
Aylmer, PQ
 
FYI

Problem resolved: add "me.refresh" as the last line in the form load event.

Massive brain fart.

John S
Aylmer, PQ
 
Back
Top