Write Conflict

G

Guest

On my form I have 2 fields. Rate and Updated.

I am using the after update event on the Rate field to run an update query
to change the filed Updated to Now(). The purpose is to record the date on
which the Rate is changed.

however Write conflict. This record has been changed by another user since
you started editing it.

Does anyone know what the problem is and how to fix it?

Bruce
 
P

PC Datasheet

Hi Bruce,

First of all, do you realize that Now() gives you both the current date and
current time? If you just want the current date, use the Date() function.

To make your form work correctly, delete your Afterupdate code, you don't
need it! Just open your form in design view, select the Updated field, open
properties and go to the Data tab. In the Default Value property, enter
Now() or Date() whichever you choose to use. Now when you enter Rate and
create a new record, Updated will be automatically filled with the current
Date and Time or current Date depending on whether you set the default value
to Now() or Date().
 
G

Guest

Thanks,

But Default value only works for new records, not existing ones that are
changed. That is why I wanted to use the update query to change this when the
record is changed.

Any other ideas or how I get around my problem?

Bruce
 
G

Guest

Hi Bruce,

It sounds like your info is being changed when the rate is changed, then
changed again when you run the query. You should save the record, then run
the query.

(As an aside, instead of using a query you could use code to change the
Updated value, using the Rate_AfterUpdate event:ie. Updated.value=Date)

HTH,
Storm.
 
G

Guest

Got it with the code. Very Cool

ihatepaperwork said:
Hi Bruce,

It sounds like your info is being changed when the rate is changed, then
changed again when you run the query. You should save the record, then run
the query.

(As an aside, instead of using a query you could use code to change the
Updated value, using the Rate_AfterUpdate event:ie. Updated.value=Date)

HTH,
Storm.
 

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

Similar Threads


Top