Solved

Refresh Form After Update

Posted on 2006-10-23
6
2,267 Views
Last Modified: 2009-02-25
I have several subforms pointing on to the same table. This because each subform represents a particular part of this table (ex. Week 1, Week 2, so on). So each subform filters a segment of the source table- Without overcomplicating with a separate table for each form, I decided to only maintain one table.

The form/subform allows a user to change a percentage in a Text Box- and then After Update- I have a number of Update Queries that are making adjustments on to the source table.

The desired effect is to have the form/subforms "refreshed" based on those changes just made. However, what does happen after the change is made in the Text Box- is essentially nothing- No data is refreshed. Not Until I make an additional change does Access prompt me because of a Write Conflict- when I an select to Save Changes- the values on the form/subform are finally refreshed.

What needs to be done in order to realize the desired effect of the After Update event?

Thanks.
0
Comment
Question by:rkentculpepper
[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
6 Comments
 
LVL 34

Expert Comment

by:jefftwilley
ID: 17793102
on the main form after update event
me.recordset = me.recordset
0
 
LVL 9

Expert Comment

by:mpmccarthy
ID: 17793136
Jeff

Could you do me a favour and look at the following question for me.  Sorry to post off topic but I'm very frustrated and I can't see it clearly any more.  It's probably something stupid.

Mary

http://www.experts-exchange.com/Databases/MS_Access/Q_22033306.html#17792967
0
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 63 total points
ID: 17793142
If you have multiple subforms with a common table in their source then yes - refreshes/writes to prevent concurrency issues are important as you've discovered.

Me.Refresh
wouldn't show you any new records than have been added (though it would allow you to see edits to records - and to start editing without worrying about creating a new write conflict).

Me.Requery
is the more agressive action - displaying any new records.  But re-positioning the cursor at the first record again.

Me.Dirty
would be a good to call as you leave a subform control.  Updates should be implicitly applied at such a time - but being opaque about should make sure.

I think what Jeff meant to suggest was
me.recordsource = me.recordsource
which is effectively the equivalent of a Requery.

Alternatively if you *did* want the recordset object - you'd have to use a Set statement
Set me.recordset = me.recordset
But it's more akin to a refresh than anything.

Hope that's all of some use too.
0
 
LVL 1

Assisted Solution

by:ncollins5900
ncollins5900 earned 62 total points
ID: 17804247
I don't know if this is what you want but this is something I did when I used subforms within a tab control. I merely created a command button and gave it a onclick event and put the below code, so that way at the press of a button the forms would update.

Probably not the BEST way to go about it, but it got it done for me.

Private Sub UpdateListsButton_Click()
    Me.Closed_subfrm.Requery
    Me.Archive_subfrm.Requery
    Me.ClosedbyAssoc_subfrm.Requery
    Me.Pending_subfrm.Requery
    Me.PendingApproval_subfrm.Requery
End sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

696 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