Problem with deleting a record

Loony22

Registered User.
Local time
Today, 18:23
Joined
Nov 30, 2001
Messages
40
Well guys iam in a big problem an i hope some one can save me.
When ever i delete a record trough a certin form (with an action button) i get this wired msg :
"The Microsoft Jet database engine cannot find a record in the table with key matching field(s) . (Error 3101)"

What is then problem with my form?
In the next letter i discribed my Tables and the Vba Script in my form , check it out and tell me what is the problem.
Plz help me ..

Loony22
 
in the form i use two Tabels : Order1 , Product :

Order1 Table:

OrderId (Key)
Product Id (Connected with Product.ProductId, Tb)
Unit Price
Quantity
Discount
Sum
Sum After Discount
Order Date (Short)
Shipment Date (Short)
Order Complete (True/False)
(And more , but it doesn't matter)

Prodcut Table:

Product Id (Key , Connected with Order1.ProductId)
Product Name
Stock (current Quantity )
Ideal Quantity
Unit In order

Vba Code (in the form)

Option Compare Database
Option Explicit

Private Sub Form_Current()
Me.Sum = Me.Quantity * Me.UnitPrice
Me.SumAfterDiscount = Me.Sum * Me.Discount
End Sub

Private Sub OrderComplete_Click()
Select Case Me.OrderComplete
Case True
Me.Stock = Me.Stock + Me.Quantity
Me.UnitInOrder = Me.UnitInOrder - Me.Quantity
Case False
Me.Stock = Me.Stock - Me.Quantity
Me.UnitInOrder = Me.UnitInOrder + Me.Quantity
End Select
End Sub

Private Sub ô÷åãä30_Click()
DoCmd.RunCommand acCmdDeleteRecord
 

Users who are viewing this thread

Back
Top Bottom