473,406 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do I requery a subform from another subform?

Hello. I have a form with 2 subforms on it, subform1 and subform2. Is
there some way to requery subform2 from an after update event on one of the
fields on subform1? What would the syntax of that be?
Me.Form.Subform.subform2.requery does not seem to work.

Robert
Feb 28 '07 #1
4 17044
If the main form has 2 subforms on it, and you want to requery #2 from #1,
try:
Me.Parent![subform2].Form.Requery

Note that it is possible to trigger an endless loop with this kind of thing,
e.g. if there is any dependency between the 2 subforms, if LinkMasterFields
depends on a calculated control, or if you have conditional formatting.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Robert" <cp******@verizon.netwrote in message
news:WL***********@newsfe03.lga...
Hello. I have a form with 2 subforms on it, subform1 and subform2. Is
there some way to requery subform2 from an after update event on one of
the
fields on subform1? What would the syntax of that be?
Me.Form.Subform.subform2.requery does not seem to work.

Robert
Feb 28 '07 #2
Thanks. When I tried that I got the error "Microsoft Access can't find the
field subform2 referred to in your expression".

"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
If the main form has 2 subforms on it, and you want to requery #2 from #1,
try:
Me.Parent![subform2].Form.Requery

Note that it is possible to trigger an endless loop with this kind of
thing, e.g. if there is any dependency between the 2 subforms, if
LinkMasterFields depends on a calculated control, or if you have
conditional formatting.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Robert" <cp******@verizon.netwrote in message
news:WL***********@newsfe03.lga...
>Hello. I have a form with 2 subforms on it, subform1 and subform2. Is
there some way to requery subform2 from an after update event on one of
the
fields on subform1? What would the syntax of that be?
Me.Form.Subform.subform2.requery does not seem to work.

Robert

Mar 1 '07 #3
In that case, the subform control may have a different name than the name of
the form that gets loaded into it.

Open the main report in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name of the control (on the Other tab)?

You need to use that name, not whatever is in the SourceObject property
(which is the name of the form to load into it.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Robert" <cp******@verizon.netwrote in message
news:o6***************@newsfe05.lga...
Thanks. When I tried that I got the error "Microsoft Access can't find
the field subform2 referred to in your expression".

"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
>If the main form has 2 subforms on it, and you want to requery #2 from
#1, try:
Me.Parent![subform2].Form.Requery

Note that it is possible to trigger an endless loop with this kind of
thing, e.g. if there is any dependency between the 2 subforms, if
LinkMasterFields depends on a calculated control, or if you have
conditional formatting.

"Robert" <cp******@verizon.netwrote in message
news:WL***********@newsfe03.lga...
>>Hello. I have a form with 2 subforms on it, subform1 and subform2. Is
there some way to requery subform2 from an after update event on one of
the
fields on subform1? What would the syntax of that be?
Me.Form.Subform.subform2.requery does not seem to work.
Mar 1 '07 #4
Bingo! When I removed the blank from the name of the subform I didn't do it
in the main form. Thanks for catching that.

"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
In that case, the subform control may have a different name than the name
of the form that gets loaded into it.

Open the main report in design view.
Right-click the edge of the subform control, and choose Properties.
What is the Name of the control (on the Other tab)?

You need to use that name, not whatever is in the SourceObject property
(which is the name of the form to load into it.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Robert" <cp******@verizon.netwrote in message
news:o6***************@newsfe05.lga...
>Thanks. When I tried that I got the error "Microsoft Access can't find
the field subform2 referred to in your expression".

"Allen Browne" <Al*********@SeeSig.Invalidwrote in message
news:45***********************@per-qv1-newsreader-01.iinet.net.au...
>>If the main form has 2 subforms on it, and you want to requery #2 from
#1, try:
Me.Parent![subform2].Form.Requery

Note that it is possible to trigger an endless loop with this kind of
thing, e.g. if there is any dependency between the 2 subforms, if
LinkMasterFields depends on a calculated control, or if you have
conditional formatting.

"Robert" <cp******@verizon.netwrote in message
news:WL***********@newsfe03.lga...
Hello. I have a form with 2 subforms on it, subform1 and subform2. Is
there some way to requery subform2 from an after update event on one of
the
fields on subform1? What would the syntax of that be?
Me.Form.Subform.subform2.requery does not seem to work.

Mar 1 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: amywolfie | last post by:
I have read the other posts on this topic, but didn't find an answer specific to what I need. I have a main form: frmFeeInput, which contains 2 subforms: 1) sfrmFootnotes 2) sfrmLoanProducts ...
1
by: BartonConstruction | last post by:
Greetings all, I have a main form (frmClients) with two subforms (subVisits) (subAccount). I got the subforms to reflect what the main form is showing by linking master and child fields (I...
1
by: dakboyan | last post by:
Hiya guys, I have a problem here that ive can't seem to solve on my own or through searching around the forums here. I would be glad if someone could assist me. This is actually an events...
1
by: Drum2001 | last post by:
Hello All, This seems like it would be simple. Is there a way to have an "After Update" event from Subform1 trigger an "add new record" on Subform2? I see posts to go from Mainform to...
0
by: Robert | last post by:
Hello. I have a form with 2 subforms on it, subform1 and subform2. Is there some way to requery subform2 from an after update event on one of the fields on subform1? What would the syntax of...
0
by: jwojr68 | last post by:
I have a bound subform that I am requerying so that records "drop off" as I check them off to validate them. This is working great, but I would like for the focus to go to the next record in the list...
13
by: BASSPU03 | last post by:
Hello, folks. This is my first post and I only began to work extensively with Access about 3 weeks ago. I'm running Access 2003 on Windows XP. I'd like a textbox in subform2 to reflect the value...
7
AccessIdiot
by: AccessIdiot | last post by:
This is driving me nuts. I have an unbound textbox (txt_SumSize) in my subform that holds the total of a field (Debitage_Size_Quantity)seen in datasheet view (control source =Sum(). I have an...
5
by: hbaf208 | last post by:
I have a combobox on a subform that is based on an SQL that uses a listbox on the unbound parent form as the criteria. When the form is first loaded, it works perfectly, limiting the dropdowns to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.