Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need some help with some code

Status
Not open for further replies.

IJOC

Technical User
Jan 27, 2009
24
US
On my order page I would like to have a button to remove and item which is record on the a continous form. I am trying to to use the following code but am getting this error:

Code:
DoCmd.RunSQL "Update tblTICards set intTICardQQH=intTICardQQH+" & Nz(hold_TIqty, 0) & " where pkTICardID=""" & Me.fkTITODCardID & """"
DoCmd.RunSQL "Update tblTICards set intTICardQQH=intTICardQQH+" & Nz(Me.intTITODCardQty, 0) & " where pkTICardID=""" & Me.fkTITODCardID & """"
Me.pkTICardNo.Requery

DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdDeleteRecord

Error:
The Microsoft Office Access database engine stopped the process because
you and another user are attempting to change the same data at the same time.

There are no other users using the DB, just me so I would image that the update to add the item back into inventory is take a little longer and stopping the deletion from the order. I hope this makes sense. Thanks again! -Pat
 
what about this ?
Code:
Me.Dirty = False
DoCmd.RunSQL "UPDATE tblTICards SET intTICardQQH=intTICardQQH+" & (Nz(hold_TIqty, 0) + Nz(Me!intTITODCardQty, 0)) & " WHERE pkTICardID='" & Me!fkTITODCardID & "'"
Me!pkTICardNo.Requery

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top