Solved

Recalc control on main form when data is entered in subform

Posted on 2014-03-20
10
1,291 Views
Last Modified: 2014-04-04
I currently have ME.PARENT.RECALC as an AfterUpdate event of a subform that updates a [=DSUM] calculated control on the main form -- which work great once the subform record has been saved to the table.

Is there a way to recalc the main form control immedately after data has been entered in the field in the subform? So when the user tabs out of the field, the calculated control on the main form immediately reflects the data that was entered?
0
Comment
Question by:jaguar5554
[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
  • 5
  • 5
10 Comments
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39943224
use the on exit event of the control to ME.PARENT.RECALC
0
 

Author Comment

by:jaguar5554
ID: 39943269
Wow! that worked (probably the only event I did not test!); however, it redirects my cursor to the first field in the first record instead of allowing me to tab to the next field in the current record. Actually, there are four (4) more fields (a total of 5 fields) that need to be entered -- all of which should recalc [on exit].  Thoughts?
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39943302
you will need to store the bookmark, and set the current row after the recalc.

see
http://www.utteraccess.com/forum/return-current-record-t1068751.html
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:jaguar5554
ID: 39943323
oh dear -- I'm not a programmer and have no idea what that means! LOL
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39943355
store the bookmark in the exit event (you programmed above) and use this bookmark when the form activate event is fired, to go to the record you want.

The bookmark will gave to be a module-level variable so you can access it from both event functions.

Dim strBookmark as String

in the exit event
strBookmark = Me.Bookmark


in the (form) activate event
Me..Bookmark = strBookmark
0
 

Author Comment

by:jaguar5554
ID: 39943721
I saved the following in a module:
Dim strBookmark as String

I added the following to the OnExit event and it looks like this:
strBookmark = Me.Bookmark
Me.Parent.Recalc

I added the following to the OnActivate event on the subform
Me.Bookmark = strBookmark

but it still jumps to the first field in the first record of the subform. Did I misunderstand your instructions?
0
 
LVL 7

Accepted Solution

by:
COACHMAN99 earned 500 total points
ID: 39944127
looks good.
are you re-querying the form when you return? This will lose the bookmark.
if so see:
http://msgroups.net/microsoft.public.access/using-bookmarks-to-select-a-record-af/14482
0
 

Author Comment

by:jaguar5554
ID: 39944257
I reviewed both links you provided and I'm still getting debug errors and can't tab beyond the first field that has the OnExit event. I will continue to research...
0
 
LVL 7

Expert Comment

by:COACHMAN99
ID: 39945583
maybe attach your code?
0
 

Author Closing Comment

by:jaguar5554
ID: 39978898
Although it solution did not resolve my issue, the feedback was good. Thank you much!
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

624 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