Requerying a subform

S

S Liu

Hi there :D Hope you can help me with a problem I'm having :(

I have form that has two subforms on it. The first one is the mai
one and contains some criminal cases (think of it as a polic
database)

Now, there is another subform underneath this one, which contain
details of all victims related to the current case. What I want i
for this subform to update automatically each time I double click o
or select a new case

Currently I have it that I can bring up the related victims b
double-clicking on the case number, but that pops up in a new window
which I did by using the following simple code on the double-clic
event

=====================
Private Sub org_case_no_DblClick(Cancel As Integer

Dim stDocName As Strin
Dim stLinkCriteria As Strin

stDocName = "View All Victims Related To Case
DoCmd.Close acQuery, stDocName, acSaveN
DoCmd.OpenQuery stDocName, acViewNormal, acReadOnl

End Su
=====================

In this, "View All Victims Related To Case" is just some store
query

I think the problem I'm having is that I'm not sure how to refer t
the victims subform, which is named "View All Victims Related To Cas
subform"

Any help would be greatly appreciated
 
R

RuralGuy

On Sun, 21 Aug 2005 07:45:30 -0500,
Hi there :D Hope you can help me with a problem I'm having :(

I have form that has two subforms on it. The first one is the main
one and contains some criminal cases (think of it as a police
database).

Now, there is another subform underneath this one, which contains
details of all victims related to the current case. What I want is
for this subform to update automatically each time I double click on
or select a new case.

Currently I have it that I can bring up the related victims by
double-clicking on the case number, but that pops up in a new window,
which I did by using the following simple code on the double-click
event:

======================
Private Sub org_case_no_DblClick(Cancel As Integer)

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "View All Victims Related To Case"
DoCmd.Close acQuery, stDocName, acSaveNo
DoCmd.OpenQuery stDocName, acViewNormal, acReadOnly

End Sub
======================

In this, "View All Victims Related To Case" is just some stored
query.

I think the problem I'm having is that I'm not sure how to refer to
the victims subform, which is named "View All Victims Related To Case
subform".

Any help would be greatly appreciated.

Maybe this link will help:
http://www.mvps.org/access/forms/frm0031.htm

If not then post back and someone will assist. Just a note: using
spaces in *any* names will eventually give you unexpected grief;
much better to use CamelFontNames or Under_Score_Names.
_______________________________________________
hth - RuralGuy (RG for short)
Please post to the NewsGroup so all may benefit.
 
S

S Liu

Never mind, figured it out. So simple I'm kinda embarrassed :lol:

Me.Parent![View All Victims Related To Case].Requer
 
S

S Liu

Oh my, that certainly was useful. Cheers

Thanks for the tip about the spaces as well. Gonna be a heck of a jo
changing all the names now, but I think I'd better do it anyway.
went against my better instincts and opted for spaces when I bega
the project. Dumb :eek:ops
 
Top