473,405 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Create Custom Expression Builder / Calculation Engine

My problem is best explained by way of tables and examples...

I am using Access 2000 (in case this is relevant) and I have a table
with the following fields...

Field names
------------
Code Description Formula Value
FIN01 Dept A - Hours Worked Null 40
FIN02 Dept B - Hours Worked Null 30
FIN03 All Departments Total [FIN01]+[FIN02]
FIN04 All Departments Average Avg([FIN01]+[FIN02])

And that is reall it...
There are two problems...

The initial problem - getting a calculated value into FIN03, I can see
that I can interrogate the Formula and reading the string search for
"[field]" and do a lookup to get the value and replace the fieldname
with the returned value eg - "40+30" - I am confused about how I add
the string together - do I have to place a val() around each field -
eg., "val(40)+val(30)" and let access work this out - or is there an
easier/better way?

The second issue is to enable the user to create functions - Live Avg -
I guess that I need to pass this string to a formula function that will
extract the string into its parts - like above - and eventually provide
a string - eg., "Avg(val(40)+val(30))" and then create individual
functions to get the appropriate result?

Again Is there a better way?

Finally - to enable the user to enter a formula - I need to create a
data entry form (very similar to the expression builder) so that they
can enter the appropriate formula - does anyone know of web link to a
code example for what I am trying to do...

All thoughts appreciated... this is keeping me awake at night - which
after 5 days is not good!....

Thanks.

Nov 13 '05 #1
3 3968
It's generally accepted practice that you NOT store calculated values.
Doing so can and will cause problems; you can display the calculated
results when needed with no performance penalty and no worries about
refreshing old underlying values.

Unless you want your users to create 50+ different expressions (and expect
them to understand how to do so and get it correct), why not have a form
with 2-10? predefined expressions, and let the user select a specific one by
radio button selection. List the expressions on the form by their English
description, add an unbound "results" textbox, then use a command button or
the AfterUpdate event of the radio button group to run select case code to
execute which expression to evaluate and display in the results control.
-Ed

"Nigel C" <ni************@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
My problem is best explained by way of tables and examples...

I am using Access 2000 (in case this is relevant) and I have a table
with the following fields...

Field names
------------
Code Description Formula Value
FIN01 Dept A - Hours Worked Null 40
FIN02 Dept B - Hours Worked Null 30
FIN03 All Departments Total [FIN01]+[FIN02]
FIN04 All Departments Average Avg([FIN01]+[FIN02])

And that is reall it...
There are two problems...

The initial problem - getting a calculated value into FIN03, I can see
that I can interrogate the Formula and reading the string search for
"[field]" and do a lookup to get the value and replace the fieldname
with the returned value eg - "40+30" - I am confused about how I add
the string together - do I have to place a val() around each field -
eg., "val(40)+val(30)" and let access work this out - or is there an
easier/better way?

The second issue is to enable the user to create functions - Live Avg -
I guess that I need to pass this string to a formula function that will
extract the string into its parts - like above - and eventually provide
a string - eg., "Avg(val(40)+val(30))" and then create individual
functions to get the appropriate result?

Again Is there a better way?

Finally - to enable the user to enter a formula - I need to create a
data entry form (very similar to the expression builder) so that they
can enter the appropriate formula - does anyone know of web link to a
code example for what I am trying to do...

All thoughts appreciated... this is keeping me awake at night - which
after 5 days is not good!....

Thanks.

Nov 13 '05 #2

"Nigel C" <ni************@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...

Again Is there a better way?

Try Microsoft Excel.
Nov 13 '05 #3
To answer the above 2 posts... I agree, the reason for this
'calculation engine' is to give the user the flexability so that I do
not need to hard code calculations for the user.
Regarding the 'calculations' available - yes it will only be predefined
as it enables parse the string and perform the relevant calculation
anyway.

To answer the other question - the user currently uses excel and has
not control over validation and how the users enter information into
the appropriate spreadsheets...so this is not really viable...

So I am still interested in reading anyone elses views...
Thanks.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David | last post by:
Hi everyone. I have read every page that Google returns on this topic, but can't find anything that resolves my problem. Basically, I have an Access Database that does a number of different...
0
by: Xproblem | last post by:
FTP Client Engine for C/C++ 2.4 Screenshot - Soft.comFTP Client Engine for C/C++ 2.4. ... System Requirements: Windows C/C++ compiler - Microsoft operating system: Windows 95, Windows 98, Windows...
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
1
by: The_Rave | last post by:
Hi everyone, I'm trying to add my own template columns to the property builder of ..NET. E.g. a checkbox column, or an image column. But I can't find the sources of the wizard, or a way to add...
7
by: Julian Jelfs | last post by:
Hi, I had an aspx pag in .Net 1.1 with a label on it. As such I had a code behind page with a declaration for that label. When I convert to Asp.Net 2.0 the code behind is converted to a...
2
by: Brian Kitt | last post by:
I have a process where I do some minimal reformating on a TAB delimited document to prepare for DTS load. This process has been running fine, but I recently made a change. I have a Full Text...
0
by: kelmen | last post by:
Greeting, I'm attempting to write customize expression-builder . As to replace\enhance the build-in Resources exp-builder. It work in a way. However, somehow the resources I retrieved using...
2
by: aeden.jameson | last post by:
I have a drop-down list the I want to use to control the visibility of button fields. Here's an example of one of my button fields, <asp:ButtonField Visible='<%$ Code:ddlReason.SelectedValue =...
3
by: Tomasz J | last post by:
Hello Developers, I have a control derived from System.Web.UI.WebControls.WebControl. Control has this property: public string Value { set { _value = value; } get { return _value; }
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.