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

Keeping running total of part numbers entered into seperate fields

I have a form for entering part numbers along with the associated quantity
for each part. There are 25 Part fields and 25 associated Quantity fields.
If I go to record 1 and enter part number 1234 for part1, 3 for quantity1,
and 1235 for part2, 8 for quantity2, and on record 2 I enter 1236 for part1,
2 for quantity1, and 1234 for part2, 2 for quantity2, how would I get Access
to spit out a report that says something like this:

Part Number Total Number of Occurrences
1234 5
1235 8
1236 2

In other words, I need Access to search for anything entered in Part1, Part2,
Part3.....Part25, and return the number of occurrences of whatever it finds.
How do I accomplish this?
Thanks in advace for any help.
--
Message posted via http://www.accessmonster.com
Nov 13 '05 #1
7 2543
Access is _data-based_, not _form-based_. You need to describe how you are
storing your data, and then perhaps someone can describe how you can create
the report you want.

Access reports do not retrieve data from forms (unless you jump through some
hoops to do so to show the criteria you used to select the data you are
reporting, for example); Access reports are bound to a Record Source -- a
table, query, or SQL statement that retrieves the data from the tables where
it resides.

Larry Linson
Microsoft Access MVP

"Shannan Casteel via AccessMonster.com" <fo***@AccessMonster.com> wrote in
message news:52***********@AccessMonster.com...
I have a form for entering part numbers along with the associated quantity
for each part. There are 25 Part fields and 25 associated Quantity
fields.
If I go to record 1 and enter part number 1234 for part1, 3 for quantity1,
and 1235 for part2, 8 for quantity2, and on record 2 I enter 1236 for
part1,
2 for quantity1, and 1234 for part2, 2 for quantity2, how would I get
Access
to spit out a report that says something like this:

Part Number Total Number of Occurrences
1234 5
1235 8
1236 2

In other words, I need Access to search for anything entered in Part1,
Part2,
Part3.....Part25, and return the number of occurrences of whatever it
finds.
How do I accomplish this?
Thanks in advace for any help.
--
Message posted via http://www.accessmonster.com

Nov 13 '05 #2
Larry,

Thank you for your reply. I'm sorry I left that information out. I should
have known to include it. Okay, to the point. Each of the part numbers is
stored in its own field in a table. There are 25 columns or fields for all
of the part numbers. There are also 25 fields for the quantities. For
example, in my table there are fields: PartNumber1,PartNumber2,PartNumber3,..
..,Partnumber25, along with quantities listed the same way: Quantity1,
Quantity2, Quantity3,..., Quantity25.

I need a way to get Access to pull out PartNumber1 - PartNumber25 along with
their associated quantities and keep a running total, so at the end of each
month I could run a report called "All Parts," and Access would give a list
of all part number that have been listed along with their total quantities
from all the records.

Please Help!

As unlikely as it may seem, I have had some experience with Access, and I'm
not afraid to do a little VBA.

Thanks,

Shannan

Larry Linson wrote:
Access is _data-based_, not _form-based_. You need to describe how you are
storing your data, and then perhaps someone can describe how you can create
the report you want.

Access reports do not retrieve data from forms (unless you jump through some
hoops to do so to show the criteria you used to select the data you are
reporting, for example); Access reports are bound to a Record Source -- a
table, query, or SQL statement that retrieves the data from the tables where
it resides.

Larry Linson
Microsoft Access MVP
I have a form for entering part numbers along with the associated quantity
for each part. There are 25 Part fields and 25 associated Quantity

[quoted text clipped - 18 lines]

Thanks in advace for any help.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #3
Long and short of it is that this design is *not* good. Stop now and
save yourself headaches later. I would normalize now before this gets
really ugly.

Any reason you can't have a design like this:

PartNo Text(50)
Quantity Long Integer

If there are several "batches" of parts or something so you have
multiple records per part, then you cannot use PartNo as your primary
key.

but then at least the summing is easy... Just use a totals query.

SELECT PartNo, Sum(Quantity) AS TotalCount
FROM Parts
GROUP BY PartNo
ORDER BY PartNo;

Nov 13 '05 #4
I'm not very good with SQL, anyway to do this with VB code?

Thanks for your help

pi********@hotmail.com wrote:
Long and short of it is that this design is *not* good. Stop now and
save yourself headaches later. I would normalize now before this gets
really ugly.

Any reason you can't have a design like this:

PartNo Text(50)
Quantity Long Integer

If there are several "batches" of parts or something so you have
multiple records per part, then you cannot use PartNo as your primary
key.

but then at least the summing is easy... Just use a totals query.

SELECT PartNo, Sum(Quantity) AS TotalCount
FROM Parts
GROUP BY PartNo
ORDER BY PartNo;

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #5
The database is for warranty claims. Parts are reimbursed. Every record
will represent a claim. Multiple parts can be listed on each warranty claim.
I kinda figured my designs was bad, but I don't know how to correct it and
make it work. I need to be able to run reports at the end of each month that
tell me all the parts that have been listed and how many times each was
listed. I'm sorry I didn't understand your post. I thought I was pretty
good with Access, but after this I've figured out that I've only scratched
the surface.

Anyway, thanks for your help.

Shannan

Shannan Casteel wrote:
I'm not very good with SQL, anyway to do this with VB code?

Thanks for your help
Long and short of it is that this design is *not* good. Stop now and
save yourself headaches later. I would normalize now before this gets

[quoted text clipped - 15 lines]
GROUP BY PartNo
ORDER BY PartNo;

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #6
"Shannan Casteel via AccessMonster.com"
<fo***@AccessMonster.com> wrote in
news:53***********@AccessMonster.com:
The database is for warranty claims. Parts are reimbursed.
Every record will represent a claim. Multiple parts can be
listed on each warranty claim. I kinda figured my designs was
bad, but I don't know how to correct it and make it work. I
need to be able to run reports at the end of each month that
tell me all the parts that have been listed and how many times
each was listed. I'm sorry I didn't understand your post. I
thought I was pretty good with Access, but after this I've
figured out that I've only scratched the surface.

Anyway, thanks for your help.

Shannan
Access is a relational database tool, the right structure for
this job is to have two related tables, the first is your claim,
the second is part-claim table, which is related to the claim
table..

Your first table has everything except the part numbers and
quantities, I assume the claimant, date claimed, etc.

The second table should have the claim number, the part number
and the quantity. If you replaced two parts on a claim there
will be two rows in this table. If you replaced four parts on a
second claim, you would have four rows more.

example of this table:
Claim_number Part_Replaced qty_replaced.
============ ============= ============
1 abcde123 2
1 fdsa765 1
2 abcde123 1
2 preasd001 3
2 ghjkl333 1
2 zzzzzz3 4

This way you can sumarize on the claim number or the part number
as you wish, just by writing different queries.

Shannan Casteel wrote:
I'm not very good with SQL, anyway to do this with VB code?

If you can do it in VBA you can do it in SQL easier.

--
Bob Quintal

PA is y I've altered my email address.
Nov 13 '05 #7
Bob,

Thank you for your time. I set up two tables (one with the regular claim
info and another with ClaimNumber, PartNumber, and QuantityReplaced). The
ClaimNumber is an autonumber and the primary key in both tables. I made a
one to one relationship between the two tables. I have a form for the parts.
It includes 25 text boxes for both the part numbers and the quantities, so 50
total. I set the control sources for each of the part number text boxes to
PartNumber from the PartsReplaced table. I set the control sources for each
of the quantity text boxes to QuantityReplaced from the PartsReplaced table.

When I enter a part number and press tab to enter the quantity, every part
number text box on the page changes to match the first. In other words, if I
enter "1234" in the first box all other 24 text boxes change to read "1234".
The same thing happens for the quantities.

Should I make the relationship one - to - many? Not really sure how to do
this...

Please help...Thanks for your time,

Shannan

Bob Quintal wrote:
The database is for warranty claims. Parts are reimbursed.
Every record will represent a claim. Multiple parts can be

[quoted text clipped - 9 lines]

Shannan


Access is a relational database tool, the right structure for
this job is to have two related tables, the first is your claim,
the second is part-claim table, which is related to the claim
table..

Your first table has everything except the part numbers and
quantities, I assume the claimant, date claimed, etc.

The second table should have the claim number, the part number
and the quantity. If you replaced two parts on a claim there
will be two rows in this table. If you replaced four parts on a
second claim, you would have four rows more.

example of this table:
Claim_number Part_Replaced qty_replaced.
============ ============= ============
1 abcde123 2
1 fdsa765 1
2 abcde123 1
2 preasd001 3
2 ghjkl333 1
2 zzzzzz3 4

This way you can sumarize on the claim number or the part number
as you wish, just by writing different queries.
I'm not very good with SQL, anyway to do this with VB code?


If you can do it in VBA you can do it in SQL easier.

--
Message posted via http://www.accessmonster.com
Nov 13 '05 #8

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

Similar topics

5
by: fwells11 | last post by:
Hi there. As you will see from my questions, I am an SQL newb. I dabble but never get to spend enough time to get proficient so base any feeedback on that basis please. This is all theoretical...
4
by: Bill Dika | last post by:
Hi I am trying to calculate a running total of a calculated textbox (tbAtStandard) in GroupFooter1 for placement in a textbox (tbTotalAtStandard) on my report in Groupfooter0. The problem...
1
by: ????? | last post by:
I have a query which shows the following fields and orders by every one in turn from left to right in ascending order. The fields are DATE, , WORK, *, DESCRIPTION and . How can I get a running...
2
by: Jana | last post by:
Using Access 97. Background: I have a main report called rptTrustHeader with a subreport rptTrustDetails in the Details section of the main report. The main report is grouped by MasterClientID. ...
12
jaccess
by: jaccess | last post by:
Hello all, I am trying to create a running total based on a specific date range that is to be entered into a form. I currently have the form set up with 2 text boxes (date1 and date2) which are...
1
by: Bruce | last post by:
I had a form with a running total working until I was asked to add some checkboxes. Here is what I have: http://www.bearzilla.net/test/Untitled-1.html The first section works, but I can't get...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
3
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I have a webform with several entry boxes and the user enters numbers in each box. I keep a running total (just adds all of the entries together) but am posting back to the server to do this. ...
5
geolemon
by: geolemon | last post by:
I'm building a small-scale MRP system for an electronics manufacturing business. There are assemblies that are built, and parts that go into those assemblies. The individual component parts that go...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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.