• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1386
  • Last Modified:

Recalc control on main form when data is entered in subform

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
jaguar5554
Asked:
jaguar5554
  • 5
  • 5
1 Solution
 
COACHMAN99Commented:
use the on exit event of the control to ME.PARENT.RECALC
0
 
jaguar5554Business AnalystAuthor Commented:
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
 
COACHMAN99Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
jaguar5554Business AnalystAuthor Commented:
oh dear -- I'm not a programmer and have no idea what that means! LOL
0
 
COACHMAN99Commented:
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
 
jaguar5554Business AnalystAuthor Commented:
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
 
COACHMAN99Commented:
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
 
jaguar5554Business AnalystAuthor Commented:
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
 
COACHMAN99Commented:
maybe attach your code?
0
 
jaguar5554Business AnalystAuthor Commented:
Although it solution did not resolve my issue, the feedback was good. Thank you much!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now