Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Replication / July 2005

Tip: Looking for answers? Try searching our database.

run time error 2115

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gennady  Vayl - 09 Jul 2005 00:47 GMT
Hi,
I have a date field in my table. I have a form for this table. In the
after update event for the form, I have this:

Private Sub Form_AfterUpdate()
LST_UPD = Now()
End Sub

When I tried testing this I got all kinds of errors, first after I edit
the record on the form the date gets posted to the LST_UPD field, but I
can't go to the next record, and when I try to quit the form it tells
me that I can't save the current record and sometimes when afterwords I
get back in the form I get #deleted...my record is gone....

so I added this:
Private Sub Form_AfterUpdate()
LST_UPD = Now()
Me!refresh
End Sub

and now I get error 2115.

I just want a date posted in a field everytime a record is updated, but
I may be going about this in the wrong way?

thanks in advance for assistance.
David W. Fenton - 09 Jul 2005 02:08 GMT
> I have a date field in my table. I have a form for this table. In
> the after update event for the form, I have this:
>
> Private Sub Form_AfterUpdate()
> LST_UPD = Now()
> End Sub

This will put you in an endless loop.

Look at it this way:

1. record changes are saved.

2. after the update, data in the record is changed.

3. thus, the record had been changed, and the data needs to be
saved.

4. loop back to 2).

Stamp the update date/time in the BeforeUpdate event of the form,
instead. That happens *before* the update, so the change to the data
doesn't retrigger the same event.

And, yes, I made the same mistake way back when.

(and this isn't a replication issue, either)

Signature

David W. Fenton                        http://www.bway.net/~dfenton
dfenton at bway dot net                http://www.bway.net/~dfassoc

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.