change tracking order of events

  • Thread starter mbr96 via AccessMonster.com
  • Start date
M

mbr96 via AccessMonster.com

I'm using Access 2002 for a facilities lease tracking system with a split
front end - back end app for a handful of users. I have change tracking
built in to the OnDirty event of the main entry screen as follows:
***
Private Sub TLCode_Dirty(Cancel As Integer)

DoCmd.OpenForm "UserChangedFields", acNormal, "", "", , acHidden
Forms!UserChangedFields!OldValue = [Forms]![Edit Lease Data]![TLCode]
Forms!UserChangedFields!UserName = CurrentUser()
Forms!UserChangedFields!FieldName = "TLCode"
Forms!UserChangedFields!ChangedWhen = Now()
Forms!UserChangedFields!LeaseID = Forms![Edit Lease Data]![LeaseID]

End Sub
***
I have also put the following event into the AfterUpdate property:
***Private Sub TLCode_AfterUpdate()

Forms!UserChangedFields!NewValue = [Forms]![Edit Lease Data]![TLCode]
DoCmd.Close acForm, "UserChangedFields"

End Sub

This works fine for manual entry. The problem is when a user goes to create
a new record from an existing one (building lease can be by floor so all the
info is the same except for the floor number). When they navigate to the one
they want to duplicate and click, Edit, Select Record, Copy, Paste Append, it
says run time error 2450, can't find the form "UserChangedFields". When I
click Debug it puts me at the first line of the AfterUpdate property code
listed above - It's as though the dirty event has not fired to open the form
first. This used to work in this app before, though nothing I've added since
should interfere. I'm confused. Any ides?

Thanks,
MBR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top