?
Solved

User requests ignored after Requery of parent form.

Posted on 2007-04-05
7
Medium Priority
?
316 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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