Can't update a record?

K

Karen

OK, I have a form and on the 'After Update' event of an address-field
textbox I take that value and plug it into a public function that calculates
the fulladdress and updates the corresponding fulladdress field in the
form's underlying table with a SQL update query.

I am getting a 'Write Conflict' error. I tried to fix it by adding Me.Dirty
= False but the problem remains.

This is the first time I have tried this, in the past I just had a hidden
field on the form whose control source was the table field.

I can fix this by adding the hidden field, but I'd really like to know why I
can't update the table with the SQL without a write conflict
 
T

Ted Allen

My guess is that your form is still in edit mode, so it
has the record locked in the underlying table and will
not allow the update query to run. I'm not sure, but if
you use Me.Refresh or Me.Requery before running the
update query it is possible that the record will be
posted and the lock released from the record.

-Ted Allen
 
K

Karen

Ted,

Thanks, I'll look at that also.

--
Karen
Ted Allen said:
My guess is that your form is still in edit mode, so it
has the record locked in the underlying table and will
not allow the update query to run. I'm not sure, but if
you use Me.Refresh or Me.Requery before running the
update query it is possible that the record will be
posted and the lock released from the record.

-Ted Allen
 
Y

Yuan Shao

Hi Karen,

How is the issue going on your side. Does Ted's suggestions address your
problem? Becase I do not have the the codes under "Update Event" in detail
and hard to reproduce yor problem so that there is not an easy way to focus
where the problem is. I found the following articles for your reference.

304181 Unexpected Write Conflict Error When You Close a Form
http://support.microsoft.com/?id=304181

295252 ACC2002: Subform Combo Box Displays Incorrect Data in an Access
Project
http://support.microsoft.com/?id=295252

295225 ACC2002: Write Conflict Error When You Add a Record in Multi-Table
View
http://support.microsoft.com/?id=295225

If you still need further assistance on this issue, please provide the
detailed repro steps and underlying codes so that I can narrow down this
problem. Thanks for your understanding.

Regards,

Michael Shao
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
K

Karen

Hi Yuan,

Ted's suggestions have helped and the links you provided certainly give me
more info. The first link really describes the problem well but, in my
situation, I didn't have a second form open BUT I tried to run some VBA code
that certainly mimics opening and closing a form and saving the record in
the meantime. For the moment, I've gone back to my hidden text fields as
time is an issue but I will pursue this further when my little project is
complete. Thanks for the help.
 

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