S
Sprinks
I have prototyped an Excel macro using a Userform that, based on the best
curve fit of price vs. size, lets a user enter an arbitrary size (x) to
return its price. The data itself, however, is buried in my code, and I'd
prefer to put it in Access.
In my macro, I've actually stored just a code for the curve type (Linear,
Quadratic, or Logarithmic), the function coefficients, and the correlation,
but if I were to use Access for the data, it seems to make more sense to
calculate on the fly from the data itself.
Two tables are required:
Items
-------------
ItemID AutoNumber (PK)
ItemName Text
Unit Text (SF, TONS, LF, etc.)
DataYear (The calculation adds escalation to prices published at the
beginning of the year)
ItemPricing
-------------------
ItemPricingID AutoNumber (PK)
ItemID (FK)
Size Integer
Price Currency
I need help with:
- Reading the Access data from the Items table when the macro is invoked
from Excel to populate a userform, creating textboxes and command buttons
on-the-fly as required.
Item Size Unit Result
Condensers, Air-Cooled TB1 TN CB1 TB2 CB2
Generators, Dieset TB1 KW CB1 TB2 CB2
TB1 is a textbox where the user enters the test value.
CB1 is the command button that performs the regression.
CB2 enters the value in the active cell.
- When the regression command button is pressed, read the appropriate data
from the ItemPrice table, using the foreign key from step 1.
- From within Access, as a quality control measure on each year's data
entry, I would like to program a button that would:
- Perform the 3 types of regression on the data
- Select the one with the highest correlation
- Display a graph of the data, showing the regression function, correlation,
and the data points
Thanks in advance.
Sprinks
curve fit of price vs. size, lets a user enter an arbitrary size (x) to
return its price. The data itself, however, is buried in my code, and I'd
prefer to put it in Access.
In my macro, I've actually stored just a code for the curve type (Linear,
Quadratic, or Logarithmic), the function coefficients, and the correlation,
but if I were to use Access for the data, it seems to make more sense to
calculate on the fly from the data itself.
Two tables are required:
Items
-------------
ItemID AutoNumber (PK)
ItemName Text
Unit Text (SF, TONS, LF, etc.)
DataYear (The calculation adds escalation to prices published at the
beginning of the year)
ItemPricing
-------------------
ItemPricingID AutoNumber (PK)
ItemID (FK)
Size Integer
Price Currency
I need help with:
- Reading the Access data from the Items table when the macro is invoked
from Excel to populate a userform, creating textboxes and command buttons
on-the-fly as required.
Item Size Unit Result
Condensers, Air-Cooled TB1 TN CB1 TB2 CB2
Generators, Dieset TB1 KW CB1 TB2 CB2
TB1 is a textbox where the user enters the test value.
CB1 is the command button that performs the regression.
CB2 enters the value in the active cell.
- When the regression command button is pressed, read the appropriate data
from the ItemPrice table, using the foreign key from step 1.
- From within Access, as a quality control measure on each year's data
entry, I would like to program a button that would:
- Perform the 3 types of regression on the data
- Select the one with the highest correlation
- Display a graph of the data, showing the regression function, correlation,
and the data points
Thanks in advance.
Sprinks