Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

form refresh is not instant 1

Status
Not open for further replies.

knot22

Technical User
Feb 17, 2008
10
US
Hello,

Attached is an MS Access 97 database which contains an example of the form refresh problem I'm experiencing.

Here is how to see the problem:
1. go to the EnterData form in the database found in the link
2. change the percentage in the Factor field to a different number
The intention is that the field called LastUpdated changes as soon as the user hits the enter key after entering the new percentage in the Factor field. However, the way it's set up now LastUpdated only changes when the user presses Shift + F9. How do I get LastUpdated to change when the user presses Enter in the Factor field?

Note that this form is purposely set up so that the user cannot enter more than one row of data into the underlying table.

Thanks, knot22

URL of example db:
 
You need a single event procedure:
Code:
Private Sub Factor_AfterUpdate()
Me!LastUpdated = Now()
Me.Dirty = False
End Sub

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV - this solution worked perfectly.
 
why the me.dirty = false
To commit the change (same as DoCmd.RunCommand acCmdSaveRecord)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top