suspend access form queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have occasional, but disastrous problems with subforms no longer tracking
their parent forms. If you look at the master/child relationship in design
view or through the debugger, it looks fine, but continues to misbehave. I
actually had to edit the already correct values to repair the form.

I inquired about the problem on this forum and drew the response "Yeah, that
sometimes happens". In response, I put defensive code behind the forms to
re-specify that relationship on any form change, as in the following example.

Case acSummaryTab
subSummaryTab.SourceObject = "subfrmSummaryTab"
subSummaryTab.LinkMasterFields = "PropertyID"
subSummaryTab.LinkChildFields = "PropertyID"

The problem? Each of these modifications to the form triggers execution of
the form's queries, making a slow application even slower.

There must be some way to tell Access to hold off until I am finished
meddling with the form, then do the queries just once, but I am drawing a
blank.

Suggestions?
 
What problems are you having? For example, if you are seeing the
SourceObject getting confused, then check it's value and only do a reset if
its wrong. That way you avoid unneccesary requerying.

If subSummaryTab.SourceObject <> "subfrmSummaryTab" Then...

I guess that whether you need to do a secondary check on the the
Master/Child ID's (even if the SourceObject is OK) would be up to what
problems you're experienced and are trying to "defend" against. I've never
seen this behaviour myself but maybe I'm just lucky.

HTH,
 
Unfortunately, that won't work. If I look at the value of the master and
child links, they look perfectly correct--but don't work. Only by setting
them again does the child begin to track the master again.
 
I think when you starting having to do all kinds of strange coding problems
to fix other problems then it is time to stop, and take a breath of air.

I see no reason why those link fields are disappearing.

You don't mention your environment, but lets do a few things:

#1) If your application is multi-user, then you will have NOTHING but
problems unless you split. Please read the following as to WHY you split
(note, it is more important to tell you WHY then simply tell you how..the
above does both).

#2) use a mde. This ensures your code is compiled, and will not be changed.

#3) ensure the service packs are installed for office and JET.

So, the most important thing here is to make sure you exiisting setup is not
all wrong, and is not a mess with a bunhc of un-compiled code etc. Get your
setup correct, and THEN start to work on probelms.

If after doing the above, you still got a problem, then you going to have to
look at code, or something that is modifying the forms reocrdsouce
property...
 
Back
Top