Write Conflict window when doing an update

D

Dan

I am using Access97 on a small 100 record database and
would like to avoid the "Write Conflict" window popping up
when I edit a record. I am the only user of this database.

I have a subform that loads by quering for item numbers
and their prices. I am trying to use the AfterUpdate event
to record the current date in a "last_modified_date" field
when I edit a price. The event is working but the "Write
Conflict" always pops up. What am I missing ? I have not
changed any of the default options of the mdb.

Any help will be greatly appreciated.
 
A

Allen Browne

Using the form's AfterUpdate event means that you immediately dirty the
record as soon as it is saved. Then it needs saving again, which triggers
Form_AfterUpdate, which dirties the record, so it needs saving again, and so
on.

Use Form_BeforeUpdate instead.
 
G

Guest

I still get the "Write Conflict" ater putting the
following code in the BeforeUpdate event :
Private Sub Text11_BeforeUpdate(Cancel As Integer)
Dim strSQL As String

strSQL = "Update quote_detail SET last_modified_date
= " & "#" & Date & "#" & _
" where quote_id = " & _
Forms!frmMain!txtQuoteID & " and partno
= " & "'" & Me.Text7 & "';"

DoCmd.RunSQL strSQL

End Sub
 
A

Allen Browne

Is [last_modified_date] in the same table as your subform?
If so, there is no need to write the value with a SQL statement.
Just set the value of the field in Form_BeforeUpdate.

Simply:
Me.last_modified_date = Now()
 

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