Statistics

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 5 tables that belong to a database. There are some interesting
statistics that I could get using 1,2 or 3 tables at a time. I want to
create a form that has all the stats I want my boss to see (about 60
statistical measures). My question is do I have to build 1 query with all
the calculations or can I do what I would like to do and that is to pick lets
say 2 tables, table A & B, and 2 fields, field 1 & 2. Divide A by B, add
fields 1 & 2, then multiple the two. Put the results in a text box on my
form, then pick another table/field, do the same things until I have about 60
text boxes with different results. Could someone show me an example of the
code if this can be done.

Thanks
Wm.
 
A form can only have a single recordsource, so you'll need to combine all
the fields from the various tables, and set up the calculated fields, in a
single query, and use that as the basis of your form.

A couple of other points:

I don't understand what you mean by "divide A by B", when A and B are
tables. That can't be done;-)

If you intend to show the stats to your boss other than directly in Access,
you should be putting them into a report, rather than a form. Forms are for
on-screen data entry/edit/viewing, reports are for presentation of
information to end-users. Although you can print a form, it's not normal
(or recommended) practice.

HTH,

Rob

"open a adobe file from a command button"
 
You could do something like (aircode)

dim db as database
dim rs as recordset
set db=currentdb
set rs=db.openrecordset("QueryName")
dim i as integer, j as integer, cnt as integer
cnt=rs.fields.count
redim answers(cnt-1,cnt) as double
rs.movefirst
do while not rs.eof
for i=1 to cnt-1
for j=i+1 to cnt
answers(i-1,j-1)=answers(i-1,j-1)+ _
rs.fields(i)/rs.fields(j)
next
next
loop

To loop through records and field comparisons. Note that you'd need to join
your tables together into a query.

"open a adobe file from a command button"
 
Back
Top