From: CDM on
I'm having problems refreshing a local table in a subform. After selecting a
new customer on the main form, my code is supposed to delete the records in
the subform and inserts the current customer's records for display . The odd
thing is that when I insert a breakpoint and step through the code
line-by-line, the subform displays the new records just as I intended. But
when I remove the break point, the subform remains on the previous customer.
What is it about executing the code line-by-line that causes the subform to
behave differently?
From: Larry Linson on
"CDM" <CDM(a)discussions.microsoft.com> wrote

> What is it about executing the code line-by-line
> that causes the subform to behave differently

The code executed line-by-line gives up control to Access and Windows
between each line, so events can occur.

As to your other problem, if you are displaying related tables and have used
the LinkMasterFields and LinkChildFields to synchronize the Form with the
Form in its Subform Control, I would not expect results such as you are
seeing the contents of the Form in the Subform should automatically be
synched when the record in the parent Form changes.

But, if your code must do something to reset the contents of the Subform, I
couldn't address that without details of your data, how it's laid out in
tables, how it's accessed, etc.. You, after all, have the database in front
of you, but we are dependent on your description to be able to help.

--
Larry Linson, Microsoft Office Access MVP
Co-author: "Microsoft Access Small Business Solutions", published by Wiley
Access newsgroup support is alive and well in USENET
comp.databases.ms-access


message news:4CAE824D-EFC8-4F97-9344-F1D690767EC2(a)microsoft.com...
> I'm having problems refreshing a local table in a subform. After selecting
> a
> new customer on the main form, my code is supposed to delete the records
> in
> the subform and inserts the current customer's records for display . The
> odd
> thing is that when I insert a breakpoint and step through the code
> line-by-line, the subform displays the new records just as I intended. But
> when I remove the break point, the subform remains on the previous
> customer.
?


From: Mike Painter on
Larry Linson wrote:
> "CDM" <CDM(a)discussions.microsoft.com> wrote
>
>> What is it about executing the code line-by-line
>> that causes the subform to behave differently
>
> The code executed line-by-line gives up control to Access and Windows
> between each line, so events can occur.
>
Inserting DoEvents should solve the problem.