When I used the database I had no issues but when my colleagues used it, they sometimes got the error:
Update or CancelUpdate without AddNew or EditI had never got the error but with mucking about with the database, I finally managed to replicate it. It occurs when you manually amend the contents of the fields that will be updated by button (in my case the date and time fields), try and amend the other data fields and then click on the update button.
I also noticed that you manually amend the contents of the fields that will be updated by button and then click on the update button, nothing happens but when you try to exit form or goto to another field, a Record Upate query box appears.
I googled around and found the problem was caused Me.Dirty being set to True. On mucking about with the code, I finally managed to come up with the solution. It involves adding VB to the After Update event of every input field to see if Me.Dirty is true and if it is then set it to False.
The code is as follows:
Sub time_update_AfterUpdate()
If Me.Dirty Then
Me.Dirty = False
End if
End SubRepeat for every input field.
0 comments:
Post a Comment