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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After Update Event works in 2003, not in 2000

Status
Not open for further replies.

cdck

Programmer
Nov 25, 2003
281
US
I am working in Access 2003, with it set to automatically save all work in 2000 format. I have a form on which 6 different fields have After Update events set up so that if one of those fields is updated, at least two other fields are re-calculated based on that update.

These events fire correctly on any machine running Access 2003. However, when a user on a machine with Access 2000 tries to use the form, absolutely nothing happens when they update any of those 6 fields - no error, no blink on the screen, nothing.

Here is the After Update event code for one of the fields. Can anyone see why this would work in 2003, but not 2000?

[tt]Private Sub CACHrs_AfterUpdate()
Me.CACLab.Value = Me.CACHrs.Value * Me.Rate.Value
Me.CTGhrs.Value = Me.CACHrs.Value - Me.ActHrs.Value
Me.CTGlab.Value = Me.CACLab.Value - Me.ActLab.Value
Me.chChange.Value = "Yes"
End Sub[/tt]

A second question is this; could Macro security levels affect events? If so, how do I change them in 2000 - they do not appear to be manipulated the same way in 2000 that they are in 2003?

Cheryl dc Kern
 
Have you checked the library references? In VBA, Tools - References. Check the versions of the libraries in the 2003 file and the Access 2000 version. Remember, you can't grow younger.
 
fneily:

I opend the database in both versions of Access and checked the libraries as suggested. I found that the differences are as follows:

In 2003: Microsoft Access 11.0 Object Library - in 2000, it's 9.0

In 2000: Microsoft DAO 3.6 Object Library - in 2003, it's not there at all.

I assume that since 2003 is where the event works, the DAO issue doesn't apply. Is there a way that I can update the Microsoft Access Library? How do I do that? I've never had to work with the libraries before.

Cheryl dc Kern
 
I looked at the suggested thread and the further links that it provided. It appeared that the reference issue pertained to situations in which a called function threw an error stating that the function was not defined, but in my situation there was no error thrown.

I tried to follow this train of thought anyway, in case it could be the issue. After much confusion, I received assistance from a co-worker who has no experience with VBA but who does know how to register libraries in Windows. Once the new library was registered, I tried to add it as a reference in Access, and it didn't work.

My coworker suggested that I try adding a line to my code to refresh the form after the code fired. I added [tt]Me.Refresh[/tt] to the code, and it now works correctly in both Access 2000 and 2003.

Thank you for you help.

Cheryl dc Kern
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top