Solved

Requery Main Form from SubForm

Posted on 1998-12-17
4
399 Views
Last Modified: 2012-05-04
I can't get a requery to occur on a main form from the AfterUpdate event of a control on the subform.  I have a control on the main form that is a calculated field, SUM(), for an aggregate, SUM()again, in the underlying query.
0
Comment
Question by:elise061298
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Helicopter
ID: 1971385
have you tried me.parent.yourcontrol.requery?
0
 
LVL 1

Expert Comment

by:surrealism
ID: 1971386
or try Me.Parent!yourcontrol.ReQuery where yourcontrol is a calculated control on the main form

0
 

Accepted Solution

by:
ABE2276 earned 100 total points
ID: 1971387
the way out is: create a summary field (hidden if you don't want to show it) in the subform - for ex.
fld2 with datasource=fld0*fld1
  place the following code in AfterUpdate Event for fld0, fld1:
  private sub fld0_AfterUpdate()
    me.recalc
  end sub
  private sub fld1_AfterUpdate()
    me.recalc
  end sub
  that will requery your subform's calculation field every time
  you change values in fld0, fld1
create field fld3 in your main form and place the following in
datasource property (let your subform name be sbfrm):
  = sbfrm.form![fld2]  
i guess that's the way out.

best regards, ABE
0
 

Expert Comment

by:ABE2276
ID: 1971388
oops !
please, replace datasource for fld2=sum(fld0*fld1)
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question