473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Add delivered quantities and assign to an order (inventory issue)

mseo
181 100+
hi,
I have a Form for add delivery Receipts and assign each product quantity for specific OrderdetailID
:
1- Form Add receipt: when I select the customer from Customer_ID combobox, I get Form1 opened with no orders
2- when I select product in the subform, Form1's Listbox will be filtered by unlocked/unfilled orders for that product
I have two problems with this Form:
1- if I select a product and entered the quantity without orderdetailID, then select orderdetailID, this problem causes the quantitydelivered field to be updated by minus value
assume I entered quantity=100 and there is no orderdetailID, then I selected an orderdetailID with quantityrequired= 1000, the result is: Quantity Delivered=0 (not updated) and if I removed or adjusted the quantity the Quantity Delivered= -100

2- if I select a product, select the orderdettailID and entered the quantity successively, if I change the product : the updated record of the order is the wrong record ( because the product changed from the combobox)(should undo the quantity delivered because the product changed)
I don't need to force the user to select the orderdetailID first before inserting the quantity because may be there are some receipts are entered without any orders just as retail
may be the problem with the code and I really don't know how to handle it
Expand|Select|Wrap|Line Numbers
  1. Public hold_qty As Long
  2. Private Sub Quantity_Enter()
  3. hold_qty = Me.Quantity
  4. End Sub
Expand|Select|Wrap|Line Numbers
  1. Private Sub Quantity_AfterUpdate()
  2. Dim db As DAO.Database
  3. Dim rst As DAO.Recordset
  4. Set db = CurrentDb
  5. If Me.OrderDetail_ID > 0 Then
  6. On Error GoTo edit_error
  7. Set rst = db.OpenRecordset("select QityDelivered from tbl_orderdetail where orderdetailID=" & Me.OrderDetail_ID)
  8. With rst
  9.     .Edit
  10.     !QityDelivered = !QityDelivered - nnz(hold_qty)
  11.     !QityDelivered = !QityDelivered + nnz(Me.Quantity)
  12.     .Update
  13. End With
  14. Me.QD.Requery
  15. Exit Sub
  16. edit_error:
  17. If Err.Number = 3188 Then
  18.     MsgBox "This record is locked by another user.  Please try this edit again later."
  19.     Me.Quantity = hold_qty
  20. Else
  21.     Me.Quantity = hold_qty
  22.  
  23. Resume exit_out
  24. exit_out:
  25. End If
  26. End If
  27. End Sub
  28.  
I need to handle two issues
2.Handling Edits
If the user changed either the quantity or the product, you have work to do. In the form's BeforeUpdate event, examine the OldValue of these controls. If either changed
3.Handling Deletes
In the continuous subform, multiple records can be selected for deletion. The Delete event fires for each record, so if the deleted record had affect on the quantity delivered, how can I undo this affect?
thank you very much

I really appreciate your help
Oct 23 '10 #1
1 2038
mseo
181 100+
hi,

I need help with this, please
Oct 26 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: db2group88 | last post by:
i have the table create with append on option (append on the data to the end of last page), so suppose the data order is by arrival sequence. but when i query use select ... order by field1, if the...
0
by: Tom | last post by:
Using AccessXP - Access2000 In my application, when an order is entered, inventory is automatically adjusted, a pull list is created, items are pulled to fill the order, and the order is...
5
by: gregork | last post by:
I have painstakingly created an excel 2000 workbook for the very complex recipes I have to formulate. I have 2 sheets- 1 for configuring the recipe and 1 that is like an inventory of all the raw...
5
by: tHeRoBeRtMiTcHeLL | last post by:
Well, I think I have bitten off a little more than I can chew (at least all at once), and I'm only trying to hammer out tables/relationships at the design level. Which translates to "Seasoned...
4
by: DeepDiver | last post by:
I am developing an inventory database in SQL Server. I realize there are many commercial (as well as some non-commercial) inventory offerings, but my client has specific requirements that would...
13
by: royaltiger | last post by:
I am trying to copy the inventory database in Building Access Applications by John L Viescas but when i try to run the database i get an error in the orders form when i click on the allocate...
1
by: keliie | last post by:
I have a relatively simple (I assume) issue which I am at a complete loss to address. My issues is: I want to populate fields in my tables with summary data from the same table. Let me explain: ...
1
by: starcandy | last post by:
haii........ ,first at all sorry because im not good in english i want to ask how to add quantity for inventory system .this is my form but it has error... <?php...
2
blyxx86
by: blyxx86 | last post by:
Great insight needed!! Good evening everyone.. I've come to a point where I can't even fathom how to go forward. I'm attempting to create a serialized inventory. I don't know where to begin....
1
by: santoshsri | last post by:
Hi below is a SQL Query written at SQL Server 2000. The result has been ordered by a.Location_Number , a.Transaction_Date, but in output the result is not ordered for eg : I am getting records for...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.