Hello,
I have an "Orders" form and "OrderDetails" subform on it.
I want to run this code:
Code:
Private Sub Form_AfterInsert()
Me.ItemOrder = DMax("ItemOrder", "vDE_PurchaseOrdersSub", "PurchaseOrderID=" & Me.PurchaseOrderID) + 1 ' this is an automatically generated ItemNumber for the particular order (1, 2, 3, etc.)
Me.Requery
End Sub
I use the Me.Requery to immediately display the value in a text box after the record is inserted.
On the Me.Requery line, I get this error:
If I remove the first line and only leave the requery, the error disappears.
Why might this be? Thank you very much.
Tomas