Solved

Refresh Form After Update

Posted on 2006-10-23
6
2,259 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
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

856 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