473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Write Conflict

158 100+
I am one of many who is having troubles with the write conflict dialog box. I've attached my code...any help would be greatly appreciated.
Expand|Select|Wrap|Line Numbers
  1. Private Sub UpdateInvoice()
  2.  
  3.   Dim rsItemMaster As ADODB.Recordset
  4.   Dim rsInvoice As ADODB.Recordset
  5.  
  6.   Set rsItemMaster = New ADODB.Recordset
  7.   Set rsInvoice = New ADODB.Recordset
  8.  
  9.   On Error GoTo ExitFunction:
  10.  
  11.   rsItemMaster.Open "tblItemMaster", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
  12.   rsItemMaster.MoveFirst
  13.   rsItemMaster.Find "Item='" & Me.cboPartNum & "'"
  14.  
  15.   If (rsItemMaster.EOF = False) Then
  16.   Me.txtDescription.Value = rsItemMaster.Fields("Description").Value
  17.   Me.txtItemCost.Value = rsItemMaster.Fields("Cost").Value
  18.   End If
  19.  
  20.   rsInvoice.Open "tblInvoice", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTable
  21.   rsInvoice.Filter = "[InvoiceNum] = " & Me.txtInvoiceNum
  22.  
  23.   rsInvoice.MoveFirst
  24.   Me.txtInvoiceTotal.Value = 0
  25.  
  26.   Do Until rsInvoice.EOF
  27.     Me.TotalCost.Value = Me.Qty.Value * Me.ItemCost.Value
  28.     Me.InvoiceTotal.Value = rsInvoice.Fields("TotalCost") + Me.InvoiceTotal.Value
  29.     rsInvoice.MoveNext
  30.   Loop
  31.  
  32.   rsInvoice.MoveFirst
  33.  
  34.   Do Until rsInvoice.EOF
  35.         rsInvoice.Fields("InvoiceTotal") = Me.InvoiceTotal.Value
  36.         rsInvoice.MoveNext
  37.   Loop
  38.  
  39.   rsItemMaster.Close
  40.   Set rsItemMaster = Nothing
  41.  
  42.   rsInvoice.Close
  43.   Set rsInvoice = Nothing
  44.  
  45.   Me.Dirty = False
  46.  
  47. ExitFunction:
  48.   'do nothing
  49.  
  50. End Sub
Thanks
Matt
Sep 15 '08 #1
3 1230
NeoPa
32,556 Expert Mod 16PB
Matt, you have a reasonably good posting record, so I don't intend to be too heavy here.

This is not a question. This is simply a way to get someone else to do your work for you.

Code is posted purely to give further information to an already clearly expressed question. Simply posting 50 lines of code and asking someone to sort it out for you, well, it's not on.
Sep 15 '08 #2
ADezii
8,834 Expert 8TB
What is the Record Source for your Form?
Sep 15 '08 #3
Jollywg
158 100+
Matt, you have a reasonably good posting record, so I don't intend to be too heavy here.

This is not a question. This is simply a way to get someone else to do your work for you.

Code is posted purely to give further information to an already clearly expressed question. Simply posting 50 lines of code and asking someone to sort it out for you, well, it's not on.

My apologies. I was in a big hurry and under a time constraint. For future posts I will be sure to post a question and supporting code as opposed to having someone sort it out for me.

Thank you
Matt
Sep 22 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Max | last post by:
Hi, I have SqlServer 2000 as back end and Access 2000 as front-end. All tables from Sqlserver are linked to Access 2000. I am having write conflict problem with one of my form which is bound to...
2
by: RC | last post by:
I am getting the following error message. "Write Conflict this record has been changed by another user since you started edting it. If you save the record, you will overwrite the changes...." I...
1
by: shumaker | last post by:
I've loked over older messages on this, but haven't found a solution. I have a datasheet of records, and each record has a subform that can be viewed with the expand '+' symbol. The subform...
5
by: Simon | last post by:
Dear reader, I have two Forms they are both working with dada from the same tables. By typing in some changes in Form-B the changes are also visible in Form-A. There is no record lock...
1
by: Kuriandungu | last post by:
Hi guys I've read the posts on Write conflict entered in this forum (along with some from kbAlertz and microsoft) and i have tried all the solutions without success. let me give you some background....
4
by: crystal | last post by:
I've checked the threads but haven't been able to come up with a solution to my issue. Help...... I have a simple form based on a table. Within the form is a subform that is also, through a Q,...
1
by: lorirobn | last post by:
Hi, I have a query that I have been using as a record source for a form with no problems. I just created a new "addnew" form, and added 20 records to the table with this form. The problem I...
8
by: christianlott1 | last post by:
After searching the group and the net, I just can't believe after all this work I'm going to have to sit through three Write Conflict messages when I want to roll back and delete a record. The...
1
by: S.Dickson | last post by:
I have a database with access as front end and Mysql as back end. I am gettting the following 'Write Conflict' Error. when i am on my order form, This form does has a subform where i enter all the...
6
by: jpatchak | last post by:
Hello, I have a main form with one subform. I have a command button on the main form to delete the current record. Below is my code. The tables on which the main form and subform are based...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.