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
Solved

Requery Main Form from SubForm

Posted on 1998-12-17
4
391 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
  • 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 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