Solved

Refresh Form After Update

Posted on 2006-10-23
6
2,253 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
6 Comments
 
LVL 34

Expert Comment

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

Expert Comment

by:mpmccarthy
Comment Utility
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
Comment Utility
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
Comment Utility
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

Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

Join & Write a Comment

Suggested Solutions

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now