Solved

Refresh Form After Update

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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

739 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