473,396 Members | 1,774 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,396 software developers and data experts.

on delete add qtyOnHand again in product table

I want QTY on hand to be updated when record in detail sale is deleted.

can any one help

Nov 13 '05 #1
3 1128
khan wrote:
I want QTY on hand to be updated when record in detail sale is deleted.

can any one help


You want to update a column that shouldn't be in your database anywhere.
This should be a calculation, calculate it whenever you need to display
it. Saving a caculation is troublesome as if you were to update this at
the delete of a detail record, if an error occurs then it may not be
updated then you'll have items that don't add up to your total.
Nov 13 '05 #2
hey trevor, I am still confused, can you explain a bit please man. i do
update when i enter sold qty in saledetail table, and I do it on before
update event of the form but i dont know how to update when you delete
a record.

Nov 13 '05 #3
khan wrote:
hey trevor, I am still confused, can you explain a bit please man. i do
update when i enter sold qty in saledetail table, and I do it on before
update event of the form but i dont know how to update when you delete
a record.


You don't. You get rid of the qtyOnHand field from your database. Never
store a total.

e.g. to get a sum of the Qty field in the detail...
If this is a textbox in header/footer of your subform, set it's
ControlSource to:
=Sum(Qty)

In the main form, it would be something like:
=DSum("Qty","tablename","FKfieldname=" & [PKFieldname])
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
4
by: Yossi Naggar | last post by:
Hello to everyone, I am an experienced user in MSSQL Server. Lately I have been started using MySQL. I managed to create my database and tables. When I wanted to execute the following query:...
16
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the...
6
by: Paul T. Rong | last post by:
Dear all, Here is my problem: There is a table "products" in my access database, since some of the products are out of date and stopped manufacture, I would like to delete those PRODUCTS from...
2
by: khan | last post by:
there is a quantity update on lost focus even of the text box i.e. it update quantity when it lost focus. Now I want this even work only if I click in this text box or if entring a new record....
3
by: Jeff | last post by:
In a subform I have a simple SQL statement that links an order details table to a product table. The form is used to enter order details. Most fields are obviously from the details table, with only...
10
by: amiga500 | last post by:
Hello, I have one basic simple question. When I have multiple records in the datagrid as follows: Code Product 1 Product 2 Product 3 11111 A B C...
3
by: igendreau | last post by:
I'm trying to clean up a database of mine, and I need to convert some old DAO code over to ADO. When I was using DAO, I had no problem running this script and deleting the record using rs.Delete. ...
4
by: =?Utf-8?B?UmljaA==?= | last post by:
On a form - I have a datagridview which is docked to the entire form. The datagridview allows users to Delete and/or Add Rows. On the Form_Load event I Fill the datagridview source table with a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.