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

Multiply quantities

Hello. I am using MS Access 2003 on Windows XP. My database is concerned with keeping track of assemblies, parts and fasteners. I have a table which relates assemblies and parts, and a second one which relates parts and fasteners. (One chair assembly for example has as parts: 1 seat, 4 legs. Each leg requires 2 screws, so the assembly requires 8 screws.) I have a form which allows users to copy existing assemblies, then modify the parts list to create a new assembly. Is it possible to create a query or table which totals each type of fastener automatically? For instance, if the user decides to only have 3 legs on his chair, I would like the query to show that the assembly requires 6 screws.

As always, you guys are a God-send.
Thanks!

nickvans
Sep 11 '07 #1
4 1763
lee123
556 512MB
you could do this in the control source of the chairs:

Expand|Select|Wrap|Line Numbers
  1. =IIf([Chairs]=3,6,IIf([chairs]=4,8))
and do this to all the rest, just follow how the code is and add on to it.

lee123
Sep 12 '07 #2
you could do this in the control source of the chairs:

Expand|Select|Wrap|Line Numbers
  1. =IIf([Chairs]=3,6,IIf([chairs]=4,8))
and do this to all the rest, just follow how the code is and add on to it.

lee123

Thanks for getting back to me. Unfortunately, this approach won't work very well for me. I have about 200 assemblies, and about as many parts, so doing it this way would be impossible. Also, if a new modification were made, a new criteria would have to be input, which is far from ideal from a data-management point of view.
Sep 12 '07 #3
lee123
556 512MB
well you can put it in the after update in the chairs like this:

Private Sub chairs_AfterUpdate()
Expand|Select|Wrap|Line Numbers
  1.  
  2.     If chairs = 3 Then
  3.         screws.Value = 6
  4. elseif chairs = 4 then
  5.         screws.value=8
  6.  
  7.     End If
End Sub

lee123
Sep 13 '07 #4
MMcCarthy
14,534 Expert Mod 8TB
Assuming a Table structure as follows:

tblAssembly
AssemblyID (Primary Key)
AssemblyName

tblPartPerAssembly
AssemblyID (Joint Primary Key)
PartID (Joint Primary Key)

tblPart
PartID (Primary Key)
PartName

tblFastnerPerPart
PartID (Joint Primary Key)
FastnerID (Joint Primary Key)
Qty

tblFastner
FastnerID (Primary Key)
FastnerName

You can now run the following query.

Expand|Select|Wrap|Line Numbers
  1. SELECT tblAssembly.AssemblyID, tblAssembly.AssemblyName, Sum(tblFastnerPerPart.Qty) As Quantity, tblFastner.FastnerName
  2. FROM ((tblAssembly LEFT JOIN tblPartPerAssembly
  3. ON tblAssembly.AssemblyID = tblPartPerAssembly.AssemblyID)
  4. INNER JOIN tblFastnerPerPart
  5. ON tblPartPerAssembly.PartID = tblFastnerPerPart.PartID
  6.  
Sep 13 '07 #5

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

Similar topics

1
by: Zhang Le | last post by:
Hi, I did a small benchmark of matrix-vector multiply operation using Numeric module. I'm a bit suprised to find matrix*col-vector is much faster than row-vector*matrix. I wonder whether other...
2
by: Martin Pettersson | last post by:
Hi all, I'm trying to multiply parent values in xsl. The thing is that I start with a value down in the xml-structure. From that value (in my case 'qty' value) I check the parent value and later...
32
by: yukatan | last post by:
Maybe it's a newbie question, but if I have two strings, let's say s1="4" and s2="5", how can I get a new string of value "9", that is, add the two numbers. If I type: var newStr = s1 + s2 all I...
15
by: christopher diggins | last post by:
Here is some code I wrote for Matrix multiplication for arbitrary dimensionality known at compile-time. I am curious how practical it is. For instance, is it common to know the dimensionality of...
4
by: trint | last post by:
Why do we have to use decimal.multiply to multiply two intgers? I just want to multiply these two values: int oneThousand = 1000; int watCHTimer1 = value from a textbox; Thanks, Trint
11
by: vips | last post by:
I have a string str="10*12*14" now I want the total of this value i.e. 10 multiply 12 multiply 14 how do i get it ? is there any function in vb.net to do that ?? if i put it as query to...
0
by: komandjaja | last post by:
Hi everybody. I am new here and I don't know much about CSS. However, I have a blog at multiply http://komandjaja.multiply.com and I have customized the CSS codes there to make a new theme. When I...
12
by: Janaka Perera | last post by:
Hi All, We have done a object oriented design for a system which will create a class multiply inherited by around 1000 small and medium sized classes. I would be greatful if you can help me...
14
by: Default User | last post by:
Hi, If I have three 64 bit integers and I want to do this operation on them: x*y/z Lets say that what we are multiplying by (y) is offset by what we are dividing by (z) so that the final...
1
by: Gavin Chen | last post by:
Hello: I tried to install Tk800.015 on SunOS 4.1.4 with perl 5.6.2. At "make test" time, I got the error message as below: collect2: ld returned 2 exit status ld:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.