Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write confict error 1

Status
Not open for further replies.

GeorgeDurkee

Programmer
Feb 22, 2000
47
US
I have a form that is used to edit data. From this form, I open another form to add new data. After adding data, I return to the main form. Everything seems to be fine.

I move to the next record on the main form and I get a write conflict error. I am the only user and I haven't changed anything. What am I doing that causes this error and how can I get around it? It does not trip the error checking, so I can't trap it.

Thanks

 
Are both forms trying to access the same info, and open at the same time? There could be a conflict there if so. I know I've had problems before when working in design mode, and had references to the same table open on separate forms and/or queries, but when in data entry mode (with all startup options enabled, or just not clicking "shift" to open, it worked fine.)

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
the main form (data correction) is open when the add form is open. the main form is updated form the add form and then the add form is closed.

What is strange, even after I say SAVE CHANGES or exit the database, when I come back, to just that record, it gives me the write conflict.
 
Could be something with the save options, especially if you're using code for that. I've run into conflicts with that before myself, and it can be a headache. Are you using code for the saving of the record? If so, try posting it here, and someone is sure to have a clue as to what is causing the conflict.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Hi, you might the following on close of the editing form:

DoCmd.RunCommand acCmdSaveRecord
DoCmd.Close 'Editing form
Forms!MainForm.Requery

HtH
 
What settngs do I look at to determine what the save settings are? I don't see any in the TOOLS...Options menu.

Using the Docmd option doesn't seem to have any effect.
 
By the way, a new wrinkle in this....When the write conflict screen comes up and I click SAVE CHANGES, it doesn't save them. I come back to the record and it says it again. As soon as I click DROP CHANGES, then I stop getting the message.

 
When you use the command in VBA:
Code:
DoCmd.CloseForm("FormName", etc, etc, etc)
One of the options, I think it's the second option (just after the "FormName"), allows you to specify if and how you save the record. I believe it is listed as acSaveRecord - will be Yes or No or similar. It should pop up when you are typing the DoCmd.CloseForm command, and after you have begun the parenthesis, or if you put a space just after the end of DoCmd.CloseForm.

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
When you use the command in VBA:
Code:
DoCmd.CloseForm("FormName", etc, etc, etc)
One of the options, I think it's the second option (just after the "FormName"), allows you to specify if and how you save the record. I believe it is listed as acSaveRecord - will be Yes or No or similar. It should pop up when you are typing the DoCmd.CloseForm command, and after you have begun the parenthesis, or if you put a space just after the end of DoCmd.CloseForm

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Oops, posted twice.. 2nd post there just took the period off the end, b/c didn't want to confuse you with the coding, though would be gramatically correct. [SMILE]

Stephen [infinity]
"Jesus saith unto him, I am the way, the truth, and the life:
no man cometh unto the Father, but by me." John 14:6 KJV
 
Just wanted to let eveybody know that I figured it out. I was changing the record in a strange place and it wasn't related to anything the error message was telling me.

Thnks for the updates and help.

 
Hi George,
I am having the same problem and have tried most of the fixes contained in the FAQ, but none seems to work. Here is my code and I am trying to edit data on a form:

Private Sub Form_AfterUpdate()

Dim db As Database
Dim rec As DAO.Recordset
Dim strOldDescript As String

Set db = CurrentDb()
Set rec = db.OpenRecordset("SELECT * FROM ACCCODES WHERE [NUMBER] = '" & _
Me![ACCCODES.NUMBER] & "'", dbOpenDynaset)

strOldDescript = rec![DESCRIPT]

With rec
.Edit
![DESCRIPT] = strDescript.Value
.Update
Debug.Print ![NUMBER]
Debug.Print ![DESCRIPT]
.Bookmark = .LastModified
.Close
End With

'DoCmd.RunCommand acCmdSaveRecord
'DoCmd.Close 'Editing form
'Forms!MainForm.Requery
'Me.Recalc
'Me.Refresh

strSave = "YES"

Set rec = Nothing
db.Close
Set db = Nothing

'Forms![ACCOUNT_CODES_MODIFY].Visible = False


This is where I have the problem of WRITE CONFLICT with the three choices:


DoCmd.CloseForm acForm, "ACCOUNT_CODES_MODIFY"


DoCmd.OpenForm "ACCOUNT CODES"

End Sub

Please can anyone suggest something else to try!
Thanks
Francis
Handle jfcj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top