MS Access application does not update unless you click?

I have developed a 37 meg. ms access 2013 application. THe problem is when I enter data into any of the forms I need to click around the application in order for the data to display on other related forms.

I know the application is poorly designed, but, I am into this project too deep to re-do the design.

What can I do to help or correct this problem?
cssc1Asked:
Who is Participating?
 
Nick67Commented:
You'll need a better understanding of how Access works.
Let's say you have a control on a form, txtMyStuff, with a ControlSource of tblStuff.MyField
In the table, there's a value --'Old'
Open the form, and txtMyStuff will show "Old" Great.

Now click in there and change 'old' to 'new'
The value of  txtMyStuff has not yet changed.
It's Value remains 'old'
It's .Text has become 'new'
When you leave the control txtMyStuff, only then does the .Value change.
Not before.
While you remain in the control, you can press ESC and revert the appearance of txtMyStuff to 'old' and not commit to any changes.

So that's the first issue (committing the changes to the tables)

The next issue is that on another form you have txtRefertoMyStuff.
It too is bound to a ControlSource of tblStuff.MyField
You open this form and txtRefertoMyStuff shows 'old'
On your first form, you change and commit txtMyStuff to 'new'
txtRefertoMyStuff will still show 'old' until it has to go back to the table to see what it's value is.

That's the second issue.
The second issue is easily dealt with.
Things you want to have happen after a value changes can be coded in a control's AfterUpdate event.

So, if you put
Private Sub txtMyStuff_AfterUpdate()
Forms!TheSecondForm!txtRefertoMyStuff .Requery
End Sub
in your code module then
txtRefertoMyStuff will get updated with the new value in txtMyStuff right after you change it.

Make sense?
0
 
Kelvin SparksCommented:
Generally, until you move off a record, the record is not saved. Until saved it is not available to any other form. And then, it will depend on how the other forms access the data as to when - for instance if you already had a continuous form bound the to table (or query) that the new record is to appear (and that form is open in another tab - or being used by another user), the new data may not appear until the form is refreshed.

You can add code to force that save sooner, and add refresh (or requery) functionaility to speed up that process elsewhere.


Kelvin
0
 
PatHartmanCommented:
As Kevin and Nick have already said, your data isn't saved until either you force the save or Access recognizes that it should automatically save because you moved to another record or closed a form.  To force the record to save without moving to a new record or closing the form, add a save button.  In the Click event of the save button, save the record if it is dirty.
If Me.Dirty = True Then
    DoCmd.RunCommand acCmdSaveRecord
End If

Open in new window


Just because you saved the record, doesn't mean that any open forms/reports will "see" the change.  
When you open a report, Access creates a Snapshot in memory of the data that the report will show.  A Snapshot is just what it sounds like - the image of something at one point in time.  You wouldn't expect to look at a photo and have it change right before your eyes and a report won't either.
When you open a form, Access creates a Dynaset in memory of the data that the form will show.  A Dynaset is "live" but on a time delay.  Records in a Dynaset that change will eventually change as you are moving through the recordset.  Records that are deleted will show #Deleted# in all columns.  Records that are added, will not show at all until you rerun the query that created the Dynaset using the .Requery method.
Reports don't refresh at all.  Forms have a refresh interval that you can control.  I think the default is around one minute.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.