ADP forms

  • Thread starter Thread starter Jjona
  • Start date Start date
J

Jjona

I am converting my .mdb form to .adp (both in Access
2000). I have an "orders" table and an "order details"
table that are placed on a form(i.e. "order details" acts
as the subform). I need to calculate the order total and
place it on the main form(i.e. extract data from the
subform and place a calulated result in the main form in
a field). I have created a stored procedure to make the
calculation, but I can't seem to place it in a field on
the form. Can someon tell me if it is a stored procedure
that I need to use or should I attempt to use ADO to make
this calulation? Incidentally, I need this to update upon
every entry in the sub form.

Many thanks in adavance,
Jjona
 
J> I am converting my .mdb form to .adp (both in
J> Access 2000). I have an "orders" table and an
J> "order details" table that are placed on a
J> form(i.e. "order details" acts as the subform). I
J> need to calculate the order total and place it on
J> the main form(i.e. extract data from the subform
J> and place a calulated result in the main form in a
J> field). I have created a stored procedure to make
J> the calculation, but I can't seem to place it in a
J> field on the form. Can someon tell me if it is a
J> stored procedure that I need to use or should I
J> attempt to use ADO to make this calulation?
J> Incidentally, I need this to update upon every
J> entry in the sub form.

Let's say, in your subform OrderDetails you have a textbox named Amount, and
you want to calculate its total in the textbox txtTotal on the main form.

1. in the subform, put a textbox named txtTotal with
controlsource=sum(Amount). You can make it invisible.
2. in the main form, set controlsource of txtTotal to =OrderDetails!txtTotal

Vadim
 
Thank you for your instructions. I performed exactly what
you said(ironically that's exactly how I did it in .mdb),
unfortunately it seems that the Project form won't
recognize the "SUM" function. I checked the object browser
and the references that are chozen are:

Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft Forms 2.0 Object Library
OLE Automation
Microsoft ActiveX Data Objects 2.7 Library

I can't figure what could be wrong

Thanks in advance,
Jjona
 
J> Thank you for your instructions. I performed
J> exactly what you said(ironically that's exactly how
J> I did it in .mdb), unfortunately it seems that the
J> Project form won't recognize the "SUM" function. I
J> checked the object browser and the references that
J> are chozen are:


make sure you put equal sign, i.e. the controlsource of txtTotal on the
subform must be

=sum(amount)

and controlsource of the textbox on the main form must be

=orderdetails!txtTotal

Vadim
 
It's interesting that you mention the "equals(=)" sign,
because I tried it with the sign & without before and it
didn't work. I would appreciate any other suggestions you
may have.

Thanks,
Jjona
 
J> It's interesting that you mention the "equals(=)"
J> sign, because I tried it with the sign & without
J> before and it didn't work. I would appreciate any
J> other suggestions you may have.

Take a look at the attached ADP, where it works. The script for creating the
tables is in the zipfile, then you'll need to populate the tables with same
values.

I have to say though that I was trying it on access 2002, however this
functionality is not new.


Vadim
 
Thank you Vadim. I inally got it to work. I ust gave up on
the form I had and started fresh and it worked
immediately. Perhaps ther ws something corrupt in the
original form. Many thanks for your help.

p.s. I don't think the newsgroups allows for attached
files - I never was able to receive your zip file - no
problem.
 
J> p.s. I don't think the newsgroups allows for
J> attached files - I never was able to receive your
J> zip file - no problem.

this depends on your newsreader, and maybe newsserver. With the OE and
newsserver msnews.microsoft.com, the message does have the attachment.

Vadim
 
Back
Top