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 / Modules / DAO / VBA / June 2005

Tip: Looking for answers? Try searching our database.

Write conflict message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Luis - 02 Dec 2004 14:07 GMT
Hi.
I've posted the following question a couple of days ago and i received the
reply i'm sending. The problem is that i'm not sure i understand how can i do
this. The form's recordsource is an SQL command that is executed in the On
Open event. How can i set the field values in the Before Update event? The
form is a continuous form and can retreive an undetermined number of records.

> Hello.
> I have a form in which i have a text box with an after update event. This
> after update event executes an Update table SQL command. The problem is
that
> after this event occurs i get an Write Conflict message. I then click on
Save
> changes button and the error disappears.
> I already put the Docmd.setwarnings FALSE command, but the message still
> triggers.
> How can i prevent this ?
>
> Thanks in advance
>
> Luis

It appears that your update is updating the same table/record that the form
is bound to.  Why?  The usual thing to do would be to set the appropriate
field values in the BeforeUpdate event, and leave it up to the form to
perform the update.
Tim Ferguson - 02 Dec 2004 18:47 GMT
>>> This after update event executes an Update table SQL command. The
>>> problem is that after this event occurs i get an Write Conflict
[quoted text clipped - 4 lines]
>> the appropriate field values in the BeforeUpdate event, and leave it
>> up to the form to perform the update.

> The form's recordsource is an SQL
> command that is executed in the On Open event. How can i set the field
> values in the Before Update event?

As the previous responder said, why would you want to? The point of binding
a form to a recordset is that Access looks after all the loading and saving
of values for you. Just let it get on with it.

> The form is a continuous form and
> can retreive an undetermined number of records.

Situation normal then: that is how Access works.

B Wishes

Tim F
Luis - 03 Dec 2004 12:07 GMT
I'm not sure if i'm being clear. The form initially is unbound, and when i
double-click on a control on another form this unbound form opens and runs a
select command as recordsource based on the value that was on the control
that was double-clicked. Ok, so far. Then i need to allow the users to update
some information contained on the form. And the problem is here. On this form
i have 2 fields, one with parcial amounts and one with total amounts, all for
the same item. On the parcial amounts control i have an after update event
that sums all the parcial amounts of the item in question to check if the sum
is less or equal to the amount. What i found out is that when i update the
parcial amount and the event triggers, i create a recordset to perform this
verification and the table in question still contains the old value. That is
why i put an SQL Update command before this verification. That was a solution
that solved the problem but triggers me the Write confilct message.

> >>> This after update event executes an Update table SQL command. The
> >>> problem is that after this event occurs i get an Write Conflict
[quoted text clipped - 21 lines]
>
> Tim F
Tim Ferguson - 03 Dec 2004 18:01 GMT
> The form initially is unbound, and when i
> double-click on a control on another form this unbound form opens and
> runs a select command as recordsource based on the value that was on
> the control that was double-clicked. Ok, so far.

No, not ok -- if the form has a recordsource then it's bound, and you may
as well use the features that Access provides. If it's unbound, then you
don't have a recordsource, and you can use the form events to write
whatever you like to the tables.

I don't see the point of fighting against Access rather than letting it do
the work for you -- but then again, I can't see your application.

All the best

Tim F
BlackmanChCh - 14 Jun 2005 03:53 GMT
=?Utf-8?B?THVpcw==?= Wrote:
> Hi.
> I've posted the following question a couple of days ago and i receive
[quoted text clipped - 33 lines]
> field values in the BeforeUpdate event, and leave it up to the form to
> perform the update.

Gidday,

Can you send me your code for this, I have a similar problem that
have fixed using me.repaint, me.refresh

BlackmanChC

--
BlackmanChChPosted from http://www.pcreview.co.uk/ newsgroup acces
 
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.