I know, I know...chemistry. *yawn*. But, can you help a chemist out?
Here's the situation:
I work in a chemistry lab in which I routinely make up drug standards and reagents that are diluted, mixed, combined, and used in various procedures.
I have been tasked with making an Access database in which we will be able to better track/inventory/order/use/locate our various standards and reagents.
More than just locating items and counting units, I really want to be able to use this db to do some powerful calculations down the road. So, I'm really trying to get it set up right from the start.
Here's my problem:
For simplicity's sake, let's say I have two types of entities I need to track in the database: Chemicals and Reagents
Chemicals: a substance that is made up of one component.
(examples: sodium chloride 99%, aspirin 100%, or ethanol 100%)
Reagents: a substance that is composed of more than one component AND/OR (this is critical) reagent
(examples:[25% aspirin in ethanol], or [25% asprin, 75% tylenol, in ethanol])
Now, if all Reagents were always composed of just Chemicals, the table relationship would be pretty easy to set up as a one-to-many.
However, it does happen in practice that Reagents may not only contain individual Chemicals, but also previously made Reagents. They may contain just more Chemicals, but they could also combine any number of previously made reagents, and any number of novel Chemicals. Or, a reagent may be composed of only two or more previously prepared Reagents, with no Chemicals.
When I went to set up the tables and the associated data entry forms, I found that I was having difficulty with making a new Reagent with previously made Reagents.
Specifically, it wasn't a big deal to have each Reagent have a subform data entry that allowed me to populate as many Chemicals as I desired within it.
However, when it came to designing the form so that a Reagent could have a subform that pointed to another Reagent as a component of it, I ran into trouble.
Isn't it self-referential to have the Reagents table pull data for a drop-down from that same Reagents table?
Another option that was suggested was to create a third type of entity, some sort of "super-reagent" category, in which I would be able to add both reagents and chemicals in separate drop down fields. However, intuitively (which may be misguided), this strikes me as not elegant and imposes a structural limitation on the number of times a reagent may be used to create a new reagent.
Hopefully this makes sense!
Any ideas? Query? Totally different table setup? 50mg of morphine IV every 4-6 hours?
Many thanks.
edit:
I'm unsure if the thread located here (you'll have to modify the web addy as I'm a new user):
programmers.co.uk/forums/showthread.php?t=204515
contains a similar problem? Still can't quite get my mind around it.
Here's the situation:
I work in a chemistry lab in which I routinely make up drug standards and reagents that are diluted, mixed, combined, and used in various procedures.
I have been tasked with making an Access database in which we will be able to better track/inventory/order/use/locate our various standards and reagents.
More than just locating items and counting units, I really want to be able to use this db to do some powerful calculations down the road. So, I'm really trying to get it set up right from the start.
Here's my problem:
For simplicity's sake, let's say I have two types of entities I need to track in the database: Chemicals and Reagents
Chemicals: a substance that is made up of one component.
(examples: sodium chloride 99%, aspirin 100%, or ethanol 100%)
Reagents: a substance that is composed of more than one component AND/OR (this is critical) reagent
(examples:[25% aspirin in ethanol], or [25% asprin, 75% tylenol, in ethanol])
Now, if all Reagents were always composed of just Chemicals, the table relationship would be pretty easy to set up as a one-to-many.
However, it does happen in practice that Reagents may not only contain individual Chemicals, but also previously made Reagents. They may contain just more Chemicals, but they could also combine any number of previously made reagents, and any number of novel Chemicals. Or, a reagent may be composed of only two or more previously prepared Reagents, with no Chemicals.
When I went to set up the tables and the associated data entry forms, I found that I was having difficulty with making a new Reagent with previously made Reagents.
Specifically, it wasn't a big deal to have each Reagent have a subform data entry that allowed me to populate as many Chemicals as I desired within it.
However, when it came to designing the form so that a Reagent could have a subform that pointed to another Reagent as a component of it, I ran into trouble.
Isn't it self-referential to have the Reagents table pull data for a drop-down from that same Reagents table?
Another option that was suggested was to create a third type of entity, some sort of "super-reagent" category, in which I would be able to add both reagents and chemicals in separate drop down fields. However, intuitively (which may be misguided), this strikes me as not elegant and imposes a structural limitation on the number of times a reagent may be used to create a new reagent.
Hopefully this makes sense!
Any ideas? Query? Totally different table setup? 50mg of morphine IV every 4-6 hours?
Many thanks.
edit:
I'm unsure if the thread located here (you'll have to modify the web addy as I'm a new user):
programmers.co.uk/forums/showthread.php?t=204515
contains a similar problem? Still can't quite get my mind around it.
Last edited: