The action was cancelled by an associated object runtimeerror "3426" when trying to execute this code:
Me.invetory_transactions.Form.Recordset.AddNew
PS: it only happend when the recordset is empty.
it doesnt happen if records are existing and we are adding to them
Private Subtype_AfterUpdate()
Dim db As Database, tb As Recordset
Set db = CurrentDb
Set tb = db.OpenRecordset("Select * from Materialtable1 where ID =" & Me.Type.Column(1))
Do Until tb.EOF = True
With tb
Form_InventoryTransactions.material = tb!Material1
Form_InventoryTransactions.Rate = tb!Rate1
Form_InventoryTransactions.Unit = tb!Unit1
Form_InventoryTransactions.materialid = tb!materialid
End With
tb.MoveNext
Me.invetory_transactions.Form.Recordset.AddNew
Loop
tb.Close
db.Close
Me.invetory_transactions.Form.Recordset.AddNew
PS: it only happend when the recordset is empty.
it doesnt happen if records are existing and we are adding to them
Private Subtype_AfterUpdate()
Dim db As Database, tb As Recordset
Set db = CurrentDb
Set tb = db.OpenRecordset("Select * from Materialtable1 where ID =" & Me.Type.Column(1))
Do Until tb.EOF = True
With tb
Form_InventoryTransactions.material = tb!Material1
Form_InventoryTransactions.Rate = tb!Rate1
Form_InventoryTransactions.Unit = tb!Unit1
Form_InventoryTransactions.materialid = tb!materialid
End With
tb.MoveNext
Me.invetory_transactions.Form.Recordset.AddNew
Loop
tb.Close
db.Close