By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,335 Members | 2,313 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,335 IT Pros & Developers. It's quick & easy.

Write Conflict

100+
P: 158
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
Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,494
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
Expert 5K+
P: 8,638
What is the Record Source for your Form?
Sep 15 '08 #3

100+
P: 158
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

Post your reply

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