psquillace,
Well as I say... if Quant1 thru Quant 25 and Price1 thru Price25 are
bound fields, add them up this way...
=Quant1 + Quant2 + Quant3..... + Quant25
=Price1 + Price2..... +Price25
Since TotalAmount is calculated, you can add them up this way...
= (Quant1 * Price1) + (Quant2 * Price2)..... + (Quant25 *
Price25)
But... while we might be able to get the form to "appear" to work,
you'll
never be able to properly report or query your sales information.
I know you're disappointed, but that's why we've had so much trouble
adding these values.
If by "project" you mean this Order form... that can be done in
three
weeks.
Your ISBN table with your prices should be OK. If you have a
tblCustomers, that should be OK too.
You just need to create a new tblOrders, and a tblOrderItems, and
create
a new Main form and Subform to properly capture the Order data..
Given the table you have now, those "single" fields (like OrderDate,
CustomerName, CustomerAddress) should be put in the ONE table tblOrders
along with an OrderID Autonumber field.
Example table design...
OrderID - AutoNumber
OrderDate - Date/Time
CustName - Text 40
CustAddress - Text40
etc.....
Those "multiple fields" like ISBN1-25, Quant1-25, Price1-25 etc...
should
be placed in the MANY tblOrderItems.
Example table design...
OrderID - LongInteger
ISBNNo - Text 50
Quant - Number/Integer
Price - Number/Single
(LineTotal - (**there will be no field for this... it will be
calculated**))
Etc... if you have more MANY fields
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
Well, thanks for that saddening news Al, although I appreciate all
your
help
I might have to ditch this project all together because it took me 1
month
to
get to this point and to start over would be a killer. I only have 3
weeks
left to finish this so starting over is not an option.
Thanks again,
--
---------------------------
I only speak in php/mySQL
so excuse my english....
---------------------------
http://www.gzws.com
:
psquillace,
Yes... unfortunately I thought so...
Sorry to be the bearer of bad news but...
Your table design is basically unworkable. You are not using the
relational power of Access, and this design will cause no end of
headaches
and problems. These problems are too numerous to list...
For example, to add Quant with your setup, you'd need this
calculation...
= Quant1 + Quant2 + Quant3 ...thru... Quant25
In a properly design database, it would be...
=Sum(Quant)
Very simply, you should have two tables, tblOrders and
tblOrderItems,
"related/linked" together by a common unique key field like OrderID.
Orders
is the ONE side of the relationship, and tblOrderItems is the MANY.
Your main form will be based on tblOrders, and your subform will
be
based
on tblOrderItems.
My only suggestion at this point would be to take a step back,
and
read
up on how realational databases are designed, and how data tables
should
be
organized and related. It is beyond the scope of email newsgroups
to
describe in all the details how to do that. This is where your
"sweat
equity" will be necessary.
Try getting a basic Access reference book and study up on table
design,
normalization, and developing One to Many realtionship and forms.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
Hi AL:
Thanks for all your help with this. I wish there was a way I
can
send
you my mbd file so you can just see what I am talking about. To
answer
your
questions this is what I have set up so far.
The form is set up as one page order form where at the top is the
customers
drop down box linked to all our customers. When they pick the
customer,
it
autofills through VB script, all the bill to information.
Then, I have 25 lines going down the page, no subform, same page
with
25
dropdown boxes all called ISBN1, ISBN2 and so on. (we sell books)
This
is
also linked to our inventory so when you pull the book you want,
it
autofills
the name of the book( BookTitle1, BookTitle2, and so on). Then
there is
a
Text Box Field called Quant named quant1 quant2 then the Text Box
PerPrice
for the price of the book and lastly the TotalAmmount box which
totals
up
the
line. So to make it more clear, here it is the book part laid out
ISBN1 BookTitle1 Quant1 PerPrice1 TotalAmmount1
ISBN2 BookTitle2 Quant2 PerPrice2 TotalAmmount2
ISBN3 BookTitle3 Quant3 PerPrice3 TotalAmmount3
What I want to do is total up the Quant PerPrice and TotalAmmount
at
the
bottom all on the same form if possible. I started to do this by
putting a
TextBox at the bottom of each and tried to just calculate it by
putting
a
control source of =Sum([Quant]) but I kept getting an error and
that is
where
I am at with you.
to answer your questions I have no SubForms in there yet. And I
did not
try
what you suggested yet as I want to be on the same page with you
first.
Thanks again,
Paul
---------------------------
I only speak in php/mySQL
so excuse my english....
---------------------------
http://www.gzws.com
:
Paul,
Let's make sure we're on the same page...
Describe your Order form.
Does it consist of a Main form that holds the information
about
the
OrderNo, Customer, Address. etc... (the ONE information of a One
to
Many
relationship)? I mean... something like a tblOrders
Do you then have a subform where you enter all the items that
the
customer orders, supported by a table something like
tblOrderItems...
related to the main form via some key field like an OrderID, in a
One
to
Many relationship?
On that subform do you have a manually entered Quant field, a
PerPrice
field that indicates the PerPrice (tell me more about how you get
PerPrice... Dlookup? Bound field?, and finally a calculated (on
the
subform) field that calculates Price * Quant.
** Did you do as I suggested and rename your Quant total
calculation
to
SumQuant. A control with = Sum(Quant)
can NOT be named Quant.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
message
Thanks Al but I am a complete newbie and will need more help to
this
if
you
don't mind.
I have 3 fields at the bottom of my form all totaling 3
seperate
fields.
Some are calculated and some are not.
The "Quant" one is a field that people will just use to enter
in, no
calculation used.
The "PerPrice" column pulls from a Query
and the "TotalAmmount" is calculated in VB editor to total
Quant *
PerPrice=
So what I am asking is can you explain this in newbie terms so
I can
understand what you are saying.
Sorry for my newbiness.
Paul
:
psquillace,
In the query behind your form, add a bound calculated
field.
Using
the
query design grid set up the calculation you used to derive
the
Quant
value.
For ex. a calculation like Price * Qty
Quant : Price * Qty
Now use this "bound" field Quant on your form in place of
your
old
unbound calculated field, and sum the column in the group
footer,
or
report
footer.
=Sum(Quant)
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
message
Thanks Al for your help,
What if it is a Calculated "unbound". How
would I
go
about
summing that up.
Also, I have 50 "quant" lines so changing all of them would
be my
last
option.
Thanks again,
Paul
:
psquillace,
First, make sure your not summing a calculated "unbound"
field.
Secondly, if you've named this field Quant, change it to
something
other