Problem refreshing subform

C

CDM

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?
 
L

Larry Linson

CDM said:
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:[email protected]...
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.
?
 
M

Mike Painter

Larry said:
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.
 

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