How to call Excel Functions

F

Forrest

Microsofts article 198571, Example 2 shows how to call the Excel Chi-Squared function. I attached this code to a command button, works great. I have tables in a one-to-many relationship and want to reference the field vs hard coding numbers. Any thoughts? Thanks in advance

Example 2 code adjusted for Access 200

Sub xlMedian(
Dim objExcel As Excel. Application
Set objExcel = CreateObject("Excel.Application"
MstBox objExcel.Application.WorksheetFunction.ChiInv(0.05, 10
objExcel.Qui
Set objExcel = Nothin
End Sub
 
T

TC

You are really asking: "How do I reference the values of fields from tables
with a one-to-many relationship?", no?

This will get the value of one field from one record chosen at random from
one table, into a local variable:

dim sField as Integer ' or String, Date, whatever.
sField = DLookup ("name of field", "name of table")

HTH,
TC


Forrest said:
Microsofts article 198571, Example 2 shows how to call the Excel
Chi-Squared function. I attached this code to a command button, works great.
I have tables in a one-to-many relationship and want to reference the field
vs hard coding numbers. Any thoughts? Thanks in advance.
 
F

Forrest

Yes and no, TC. The Excel function works on two or more data points, example #2 hard codes 0.05, and .10
I need to capture all values within the specified field and run the function against a list of values in the same field. The record count could contain up to a couple hundred records. Is that doable? Currently I accomplish this task in Excel where the function references a range
Thanks for your response and I hope I clarrified what I am trying to accomplish

----- TC wrote: ----

You are really asking: "How do I reference the values of fields from table
with a one-to-many relationship?", no

This will get the value of one field from one record chosen at random fro
one table, into a local variable

dim sField as Integer ' or String, Date, whatever
sField = DLookup ("name of field", "name of table"

HTH
T


Forrest said:
Microsofts article 198571, Example 2 shows how to call the Exce
Chi-Squared function. I attached this code to a command button, works great
I have tables in a one-to-many relationship and want to reference the fiel
vs hard coding numbers. Any thoughts? Thanks in advance
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top