Im using this code to update a bunch of records on multiple tables. They're all visible on open forms and sub forms. The last one in the statement - "EmbroideryDetails" was originally on a tab - and the code broke saying "Can't find the Form EmbroideryDetails" . I tried just for the heck of it taking it off the tab...but it still can't find it. The rest of the code works GREAT. What am I doing wrong? I feel like I'm making a stupid mistake I can't see. Here's the code so far..... Thank you SO MUCH!!!!!
Private Sub ReOrder_Click()
Dim db As Database
Dim rs As Recordset
Dim num As Long
Set db = CurrentDb
Set rs = db.OpenRecordset("Orders"
With rs
.AddNew
num = !OrderID
!CustomerID = Forms![Orders].CustomerID
!FreightCharge = Forms![Orders].FreightCharge
!OrderDate = Date
!EmployeeID = 1
!PurchaseOrderNumber = Forms![Orders].PurchaseOrderNumber
!SalesTaxRate = Forms![Orders].SalesTaxRate
!RefOrderID = Forms![Orders].OrderID
.Update
End With
Set rs = db.OpenRecordset("Order Details"
With rs
.AddNew
!OrderID = num
!Quantity = Me.Quantity
!UnitPrice = Me.UnitPrice
!Discount = Me.Discount
!setupcharge = Me.setupcharge
!RushCharge = Me.RushCharge
!Description = Me.Description
.Update
End With
Set rs = db.OpenRecordset("EmbroideryDetails"
With rs
.AddNew
!OrderID = num
!UV = Forms![EmbroideryDetails].UV
.Update
End With
db.Close
End Sub
Private Sub ReOrder_Click()
Dim db As Database
Dim rs As Recordset
Dim num As Long
Set db = CurrentDb
Set rs = db.OpenRecordset("Orders"
With rs
.AddNew
num = !OrderID
!CustomerID = Forms![Orders].CustomerID
!FreightCharge = Forms![Orders].FreightCharge
!OrderDate = Date
!EmployeeID = 1
!PurchaseOrderNumber = Forms![Orders].PurchaseOrderNumber
!SalesTaxRate = Forms![Orders].SalesTaxRate
!RefOrderID = Forms![Orders].OrderID
.Update
End With
Set rs = db.OpenRecordset("Order Details"
With rs
.AddNew
!OrderID = num
!Quantity = Me.Quantity
!UnitPrice = Me.UnitPrice
!Discount = Me.Discount
!setupcharge = Me.setupcharge
!RushCharge = Me.RushCharge
!Description = Me.Description
.Update
End With
Set rs = db.OpenRecordset("EmbroideryDetails"
With rs
.AddNew
!OrderID = num
!UV = Forms![EmbroideryDetails].UV
.Update
End With
db.Close
End Sub