patapotato
New member
- Local time
- Today, 21:51
- Joined
- Oct 6, 2022
- Messages
- 15
Fortunately, the formulas don't need to be changed by a user. And if they did, they would need to be recorded under a new recipe anyway.
However, they do change between recipes and chemicals. The formulas themselves, as well as the coefficients they use, are different for every chemical-recipe pair. So chemical A in Recipe A will have a different formula than Chemical A in Recipe B and might use coefficient A in the former and coefficient B in the latter on top of that. So I will have to relate them to that combination of recipe and chemical, rather than just the chemical. That also means that just swapping out a coefficient within the formula will not be enough to differntiate between different recipe-chemical pairs.
As for class inheritance, I meant this:
sql server - How can you represent inheritance in a database? - Stack Overflow
Entity–attribute–value model - Wikipedia
But I don't think access has the option to implement this, at least I have not seen any way in which I could. And even then, I like having coefficients in a table by themselves better for this project.
I was thinking of saving calculations in queries. Each query being used as a recordsource for a form or subform (the queries get saved like this, coefficient's default values are in tables, the queries will use those). Then switch out the recordsource from one query to the next depending on the current record used. If a subform would require a totally different content with different controls on it (which is frequent although there are types by which I can group them), I switch out the SourceObject of the subform container. The names of both the query, as well as the form it should be used in are saved to the database and related to the recipe in which they find use. They will be in two seperate tables so that one subform name can be associated with many different queries so long as the fields those queries create match those of the subform's controls. There are some subforms which need not be swapped out very often, like the one containing my version of the weightmaster, of which there are only 2 different versions neccesary. For others, like the optional calculations tables, there are about 5 different forms that I would likely need since there are 5 product types that use a very different specialty table here. In total, I think I can get away with 14 subform options and many many more queries for the whole of the 239 recipes that I have if I have counted correctly.
In the case of using different formulas for different chemicals in every recipe, assuming one subform holding controls for every chemical used in the recipe (like in a continuous form) I would use the switch() function to differentiate between chemicals within one recipe. First I wanted to use Case() in sql but I found out Access doesn't interpret that command.
The end result will be a dynamic form that changes control elements and calculations within them depending on the recipe that was selected. The layout or design of those elements or subforms, or even the masterForm does not really matter and I am not concerned with that atm. I am working out the framework by which this will function and how it will affect the design of the table relationships. Depending on how I implement this, the tables will have to look differently and some of the relationships might too.
However, they do change between recipes and chemicals. The formulas themselves, as well as the coefficients they use, are different for every chemical-recipe pair. So chemical A in Recipe A will have a different formula than Chemical A in Recipe B and might use coefficient A in the former and coefficient B in the latter on top of that. So I will have to relate them to that combination of recipe and chemical, rather than just the chemical. That also means that just swapping out a coefficient within the formula will not be enough to differntiate between different recipe-chemical pairs.
As for class inheritance, I meant this:
sql server - How can you represent inheritance in a database? - Stack Overflow
Entity–attribute–value model - Wikipedia
But I don't think access has the option to implement this, at least I have not seen any way in which I could. And even then, I like having coefficients in a table by themselves better for this project.
I was thinking of saving calculations in queries. Each query being used as a recordsource for a form or subform (the queries get saved like this, coefficient's default values are in tables, the queries will use those). Then switch out the recordsource from one query to the next depending on the current record used. If a subform would require a totally different content with different controls on it (which is frequent although there are types by which I can group them), I switch out the SourceObject of the subform container. The names of both the query, as well as the form it should be used in are saved to the database and related to the recipe in which they find use. They will be in two seperate tables so that one subform name can be associated with many different queries so long as the fields those queries create match those of the subform's controls. There are some subforms which need not be swapped out very often, like the one containing my version of the weightmaster, of which there are only 2 different versions neccesary. For others, like the optional calculations tables, there are about 5 different forms that I would likely need since there are 5 product types that use a very different specialty table here. In total, I think I can get away with 14 subform options and many many more queries for the whole of the 239 recipes that I have if I have counted correctly.
In the case of using different formulas for different chemicals in every recipe, assuming one subform holding controls for every chemical used in the recipe (like in a continuous form) I would use the switch() function to differentiate between chemicals within one recipe. First I wanted to use Case() in sql but I found out Access doesn't interpret that command.
The end result will be a dynamic form that changes control elements and calculations within them depending on the recipe that was selected. The layout or design of those elements or subforms, or even the masterForm does not really matter and I am not concerned with that atm. I am working out the framework by which this will function and how it will affect the design of the table relationships. Depending on how I implement this, the tables will have to look differently and some of the relationships might too.