[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

User requests ignored after Requery of parent form.

Posted on 2007-04-05
7
Medium Priority
?
324 Views
Last Modified: 2013-11-28
I am attempting to write VB code in Access to requery a parent form after updating a subform.  So far I can requery the parent form and return to the original record,(using Bookmark) but any action, such as clicking on a Next or Previous button on the parent form (which caused the subform to be updated in the first place) is ignored and the user has to click on the action button again.  Is there a way to force Access to continue on with the original request?
0
Comment
Question by:jlwhite1
[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
  • 4
  • 3
7 Comments
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18862434
you've described some elements in your question...that we're SURE are clear as a bell to you....but don't make sense to us. We don't know what your Action Button is, we don't know what you're trying to accomplish. Is there a specific control on the main form that requires updating after you change something in your subform? Usually that is the other way around...so can you expound some...so we can help you?
0
 

Author Comment

by:jlwhite1
ID: 18862490
Ah, you mean you are not mindreaders? !   I am requerying a parent form's recordsource after the update of a subform.  When the user makes a change to the subform, which has only one field, he normally will click on something in the main form which will take him to the next record or he might select another subform on the same record or another action that moves away from the originl subform.  That triggers the requery action for the parent form.  Even though I can get back to the original record after the requery, whatever the user wanted to do (move to the next record on the parent form, etc.) is lost. Is there a way to get Access to continue on with the user's original request after the requery and return to the original record have happened?
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18863031
ok, not to take anything away from your method, but why are you requerying the main form and from what event on your subform. Are you updating something in your subform, that affects a total, or a control on your main form? My thought here is that you can requery just that object, and not the entire main form.
We do try to read minds, but often it's easier to examine method. I understand your problem, and a quick answer is sure...with some pretty nifty coding, and of course...speaking of reading minds...we'd have to be able to guess what button your user is going to push as his next action.
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:jlwhite1
ID: 18863365
I'm requerying the parent form because one of the fields on the parent form is a concantonated field consisting of, of course, the entries on the subform (long story - wish it didn't have to be that way).  I've tried requerying just the field on the parent form, but because the original field has to be deleted and re-added, that field shows #deleted# even after a field requery.  We don't know what the user is going to do on his next action, it could be one of many.  Maybe my only choice is to put a 'requery' button on the subform and train users to click on it; make it the next in the tab sequence so it's easy.
0
 
LVL 34

Accepted Solution

by:
jefftwilley earned 1600 total points
ID: 18863570
how about this....instead of requerying the main form when you leave the subform, you calculate the control on the main form.

The change made in the subform is only committed once the user either hits a save button...or leaves the record. So if the focus is on the subform, then you're actually using the fact that you're leaving the form, to commit the record. Problem with that is the value for your main form's control may or may not "find" that last change.

so...

on your subform after_update event

me.dirty = false
me.parent.control = (your formula here)
me.parent.refresh

give that a shot.
0
 

Author Comment

by:jlwhite1
ID: 18864345
Well, that wouldn't exactly work, but it sent me down the right track.  I was deleting the field when all I needed to do was update it on the form.  I reworked the code and all is workng as planned now!. Thanks for setting me straight!
0
 
LVL 34

Expert Comment

by:jefftwilley
ID: 18864382
happy to help!
J
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

656 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