Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Refresh Form After Update

Posted on 2006-10-23
6
Medium Priority
?
2,280 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
4 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 252 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 248 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
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.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

810 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