Advertisement
Guest User

code

a guest
Jan 28th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. Sub UpdateOrderIntoAccessCMD()
  2.  
  3. Dim uporderid As Long
  4. 'Dim upcustid As Long
  5. 'Dim upcustname As String
  6. Dim updeliverydate As Date
  7. Dim uporderdate As Date
  8. Dim upcustref As String
  9. 'Dim updeladd As String
  10. 'Dim upcustadd As Integer
  11. Dim updeladd1 As String
  12. Dim updeladd2 As String
  13. Dim updeladd3 As String
  14. Dim updeladd4 As String
  15. Dim updelpostcode As String
  16. Dim upspecialdel As String
  17. Dim updriver As String
  18. Dim upinstaller As String
  19. Dim upinstalldate As Date
  20. Dim upnotes As String
  21.  
  22. uporderid = UpdateOrder.TextSGGOrderNo.Value
  23. 'upcustid = UpdateOrder.TextCustID.Value
  24. 'upcustname = UpdateOrder.ComboBoxCustName.Value
  25. updeliverydate = UpdateOrder.DPdeliverydate.Value
  26. uporderdate = UpdateOrder.DPorderdate.Value
  27. upcustref = UpdateOrder.TextCustOrderNo.Value
  28. updeladd1 = UpdateOrder.Textdeladd1.Value
  29. updeladd2 = UpdateOrder.Textdeladd2.Value
  30. updeladd3 = UpdateOrder.Textdeladd3.Value
  31. updeladd4 = UpdateOrder.Textdeladd4.Value
  32. updelpostcode = UpdateOrder.Textdelpostcode.Value
  33. upspecialdel = UpdateOrder.Textspecialdel.Value
  34. updriver = UpdateOrder.ComboBoxdriver.Value
  35. upinstaller = UpdateOrder.ComboBoxInstaller.Value
  36. upinstalldate = UpdateOrder.DPInstallDate.Value
  37. upnotes = UpdateOrder.TextNotes.Value
  38.  
  39. Dim dbs As Database
  40.  
  41.  
  42. Set dbs = OpenDatabase("" & ThisWorkbook.path & "\Customer Database.accdb")
  43.  
  44. ' dbs.Execute "UPDATE ORDERHEADER SET deldate='" & updeliverydate & "', date='" & uporderdate & "', custref='" & upcustref & "', address1='" & updeladd1 & "', address2='" & updeladd2 & "', address3='" & updeladd3 & "', address4='" & updeladd4 & "', postcode='" & updelpostcode & "', specialdel='" & upspecialdel & "', driver='" & updriver & "', installer='" & upinstaller & "', installdate='" & upinstalldate & "', notes='" & upnotes & "' WHERE ID=" & uporderid & ""
  45.  
  46.  
  47.  
  48. dbs.Execute "UPDATE ORDERHEADER SET" & _
  49. " deldate='" & updeliverydate & "', date='" & uporderdate & "', custref='" & upcustref & "'," & _
  50. " address1='" & updeladd1 & "', address2='" & updeladd2 & "', address3='" & updeladd3 & "', address4='" & updeladd4 & "'," & _
  51. " postcode='" & updelpostcode & "', specialdel='" & upspecialdel & "', driver='" & updriver & "', installer='" & upinstaller & "', installdate='" & upinstalldate & "', notes='" & upnotes & "'" & _
  52. " WHERE ID=" & uporderid & ""
  53.  
  54. dbs.Close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement