Re: Duplicate Record with .ADDNEW
- From: "JP Bless" <jp3BlessNoSpam@xxxxxxxxxxx>
- Date: Fri, 10 Nov 2006 11:07:09 -0500
<mamin@xxxxxxxxxxxxxxxxx> wrote in message
news:1163162480.339497.240000@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
Lately I am having very strange issue with my code and not sure what is
causig issue.
I have following code which creates new entry in table
===========================================
rsOrderItems.open "tblOrderItems", ConnOrder, adOpenStatic,
adLockOptimistic
rsOrderItems.AddNew
rsOrderItems("OrderId") = pOrderID
rsOrderItems("ProductID") = arrAmazonStoreCart(i, 0)
rsOrderItems("PricePerUnit") = (arrAmazonStoreCart(i, 2) /
arrAmazonStoreCart(i, 1)) 'Line Item total/Qty
rsOrderItems("Qty") = arrAmazonStoreCart(i, 1)
rsOrderItems("Giftwrap") = arrAmazonStoreCart(i, 3)
rsOrderItems("AmazonOrderItemCode") = arrAmazonStoreCart(i, 7)
If Trim(arrAmazonStoreCart(i, 8)) <> "" Then
rsOrderItems("GiftWrapType") = arrAmazonStoreCart(i, 8)
End If
rsOrderItems.Update
rsOrderItems.MoveLast
pOrderItemsID = rsOrderItems("orderitemsid")
rsOrderItems.Close
==============================================
Some times it will create same entry twice. I have been debugging this
issue for two days not able to find out. My best assumption is
happening in above code. If I do the same thing manually it does not
happen so I am not able to recreate issue. However it is keep happening
at least 5 to 10 times a day. This is occasional
Please let me know if anyone had this type of situation before
Thanks
How are you calling the routine? If you are calling it via KeyDown,
Keypress, Click events of any control then watch it...
.
- Follow-Ups:
- Re: Duplicate Record with .ADDNEW
- From: mamin
- Re: Duplicate Record with .ADDNEW
- References:
- Duplicate Record with .ADDNEW
- From: mamin
- Duplicate Record with .ADDNEW
- Prev by Date: Re: Duplicate Record with .ADDNEW
- Next by Date: Re: Duplicate Record with .ADDNEW
- Previous by thread: Re: Duplicate Record with .ADDNEW
- Next by thread: Re: Duplicate Record with .ADDNEW
- Index(es):
Relevant Pages
|
Loading