Hi all,
The heading probably doesnt make it clear at all what Im after,
I want to setup a database which will allow the user to enter a calculation within a field.
For instance in its simplest form, the table could contain 3 fields
Data1
Data2
Calculation
You could enter
2
3
Data1 + Data2
or
2
3
(Data1 * Data2) + Data 1
Then set up queries to format output giving me
2 + 3 = 5
(2 * 3) + 2 = 8
The database Im looking at will be a fair bit more complicated in the way of calculations but the logic is the same.
Im guessing that what I need to do is replace the likes of Data1 and Data2 with the information pulled from fields Data1 and Data2 and then run the field as a calculation.
Is it as straightforward as that? or do I need to do a lot more in the way of VBA coding to convert what is a text field into a calculation and run it?
One final thing, the overall calculations will involve different data types for instance one calculation could be adding 5 days to date held in data1 while another could be checking that the amount in data1 is less 500.
In an ideal world I would want one table with the data fields and calculation field in rather than one for date calculations, one for money ones etc.
Any help on the general logic behind it would be appreciated.
The heading probably doesnt make it clear at all what Im after,
I want to setup a database which will allow the user to enter a calculation within a field.
For instance in its simplest form, the table could contain 3 fields
Data1
Data2
Calculation
You could enter
2
3
Data1 + Data2
or
2
3
(Data1 * Data2) + Data 1
Then set up queries to format output giving me
2 + 3 = 5
(2 * 3) + 2 = 8
The database Im looking at will be a fair bit more complicated in the way of calculations but the logic is the same.
Im guessing that what I need to do is replace the likes of Data1 and Data2 with the information pulled from fields Data1 and Data2 and then run the field as a calculation.
Is it as straightforward as that? or do I need to do a lot more in the way of VBA coding to convert what is a text field into a calculation and run it?
One final thing, the overall calculations will involve different data types for instance one calculation could be adding 5 days to date held in data1 while another could be checking that the amount in data1 is less 500.
In an ideal world I would want one table with the data fields and calculation field in rather than one for date calculations, one for money ones etc.
Any help on the general logic behind it would be appreciated.