473,668 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.reque ry does not seem to work.

Robert
Feb 28 '07 #1
4 17065
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 LinkMasterField s
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******@veriz on.netwrote in message
news:WL******** ***@newsfe03.lg a...
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.reque ry 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*********@Se eSig.Invalidwro te 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
LinkMasterField s 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******@veriz on.netwrote in message
news:WL******** ***@newsfe03.lg a...
>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.Subfor m.subform2.requ ery 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******@veriz on.netwrote in message
news:o6******** *******@newsfe0 5.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*********@Se eSig.Invalidwro te 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
LinkMasterFiel ds depends on a calculated control, or if you have
conditional formatting.

"Robert" <cp******@veriz on.netwrote in message
news:WL******* ****@newsfe03.l ga...
>>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.Subfo rm.subform2.req uery 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*********@Se eSig.Invalidwro te 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******@veriz on.netwrote in message
news:o6******** *******@newsfe0 5.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*********@Se eSig.Invalidwro te 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
LinkMasterFie lds depends on a calculated control, or if you have
conditional formatting.

"Robert" <cp******@veriz on.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.Subf orm.subform2.re query 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
2102
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 When a data field in sfrmLoanProducts has a given primary key (referenced in an IF statement in VBA), then I need to insert a record into the Footnote join table.
1
2502
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 think--newbie here). Now I need the second subform (subAccount) to update when I add a visit in the subVisits subform. I assume that the AfterUpdate would do it, but I cant figure out what the code is to update another subform would be. Not...
1
1413
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 management database that im helping to create for my school. First up is the calculation part. The idea is simple...for any 1 EVENT there are multiple PUPILS that had participated. And these PUPILS are further divided by their respective CLASSES. ...
1
1985
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 Subform, but not subform to subform. Any suggestions would be greatly appreciated!
0
1409
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 that be? Me.Form.Subform.subform2.requery does not seem to work. Robert
0
1088
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 instead of jumping back to the top of the subform to the first record in the list. Anybody know how to accomplish this after a requery? Can it be done? I am using Access 2003.
13
6220
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 chosen from a combobox in subform1. FYI: Both of these subforms are linked to a main form with five fields (AutoNumber, Quantity, Resource, Type, and General Description; "AutoNumber" is the primary key). My main form lists a resource (e.g....
7
9298
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 unbound textbox on my form (txt_SizeTotal) that gets the value from the subform footer when the form loads: Private Sub Form_Load() Me.txt_SizeTotal = Me!sbfrm_DEBITAGE_Size.Form! End Sub
5
6237
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 only those associated with the listbox. However, when I update the listbox, I cannot get the combobox to requery. I've tried requery AfterUpdate on the listbox control, AfterUpdate on several subform controls, as well as trying to requery the...
0
8459
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8374
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8575
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8653
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7398
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6206
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4202
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1783
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.