473,397 Members | 1,969 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,397 software developers and data experts.

Unable to derive a customizable expression

I thank you very much for your advise besides I don't mean to make things difficult for those Helping me or make them think too much. my appologies.

Now, I have a query named "Students subform" in an access database and in this query there is a table named "Student Subform Subquery" and it has the following fields; "StudentID", "Grade", "Grade(%)"... .

The expression below works correctly. However, i thought of making it customizable thus designing a form for it and make a command button in the event proceedure to fire this action on click but do not know how to go about it.

Expand|Select|Wrap|Line Numbers
  1. Grade: 
  2. IIf([Grade (%)] Between 0.8 And 1,
  3.     "Excellent",
  4.     IIf([Grade (%)] Between 0.7 And 0.79,
  5.         "Very Good",
  6.         IIf([Grade (%)] Between 0.6 And 0.69,
  7.             "Good",
  8.             IIf([Grade (%)] Between 0.45 And 0.59,
  9.                 "Credit",
  10.                 IIf([Grade (%)] Between 0.35 And 0.44,
  11.                     "Pass",
  12.                     IIf([Grade (%)]<=0.34,
  13.                     "Fail"))))))
I have a table named "ScoreRange" and in it i have the following fields; "ID", "Range From", "Range To", "Interpretation". So I want make the "Grade" expression to pick its information from the the table "ScoreRange".

Attached is a word copy of the screen print of what i mean.

Please help.

Thank you
Attached Files
File Type: docx Grade.docx (333.2 KB, 342 views)
Jan 23 '13 #1
5 1333
Seth Schrock
2,965 Expert 2GB
However, I thought of making it customizable thus designing a form for it and make a command button in the event proceedure to fire this action on click but do not know how to go about it
I'm not sure what action you are talking about. Also, as I'm at work, I can't view your attached file.

A little side note, your query might be a little easier to read if you would use the Switch() function instead of nesting all those IIF statements. Switch Function
Jan 23 '13 #2
zmbd
5,501 Expert Mod 4TB
Emmanuel Ayivi:
It just seems to be common practice to not download or open files that are not requested. You can directly up load the jpg the same way up uploaded the docx.

Seth's suggestion for the Select is also a very good one.

Now for your other question.
You should be able to refer to the second table from within the calculated field of the query much like a lookup field. However, instead of all of those between statments I'd use a single cut-off value.
Jan 23 '13 #3
zmbd
5,501 Expert Mod 4TB
Sorry, called away for other project.

to continue my thought...

However, the logic behind the single cut off field might be a tad much

So If you use a table that has a min and max range for the grade lookup then in your query, design mode, show the table with your students grades and the grade lookup table. Pull down all of the fields from the table with the student data that you want to show (last_name, course, etc) and then pull down the field from the lookup table that has the user friendly text and set a criteria so that the student's grade is between the range.

Give it a try... if you're still haveing issues then post back.
You can then use a condition in the
Jan 23 '13 #4
NeoPa
32,556 Expert Mod 16PB
Lose the [Range To] field, as it is redundant, and return the [Student Subform Subquery] record that matches the minimum value of [Range From] which is less than or equal to [Range (%)]. Then, your field would be coded as :
Expand|Select|Wrap|Line Numbers
  1. Range: [Interpretation]
Jan 24 '13 #5
NeoPa
32,556 Expert Mod 16PB
I'd just like to add that this is a vast improvement over many recent questions that had to be deleted. This one, though not perfect, is certainly one of the better questions we get. Your effort is obvious and appreciated.
Jan 24 '13 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: MKoleoso | last post by:
Problem: C#- Unable to create instance of a class implementing from an interface I have: namespace someNamespace { public __gc class SomeClass1 { }
3
by: Marcin Kowalewski | last post by:
Hi I've got a stupid problem with code below : using System; using System.Drawing; .... public class CsrcImage :Image { public CsrcImage() { //
4
by: Gates72 | last post by:
Hello All, I am looking for an example showing a custom EventArgs class that derives from CancelEventsArgs, and a form or control using that class in a custom event. The simpler, the better,...
4
by: Henke | last post by:
Hi! I have a abstract base class that derives from System.Web.UI.Page. In this class I have some abstract methods. My other web pages should derive from this class and implement the abstract...
3
by: mcollier | last post by:
I'm having trouble getting my server controls in my code-behind file to initialize. I field names exactly match that of the control in the ASPX file. The controls are also public. However, in my...
5
by: Brian Takita | last post by:
Hello, Is there a way to unit test a that derives from IHttpHandler that uses the HttpResponse in the HttpContext passed to it? When I try to call the context.Response.End() method, I get the...
19
by: eiji | last post by:
Hi folks, I found this code in a project: > class TestList : public std::vector<Test> { /*empty!!!*/ }; Basicly this ends up in the same result like > typedef...
3
by: gyan | last post by:
Please go though following program: #include <iostream.h> class base { public: int basepublic; protected: int baseprotected; };
3
by: hufaunder | last post by:
Imagine you have a charting library that can draw lines, bars, floating bars, bands, etc. Lines and bars need only one input. Floating bars and bands need two inputs. There are two approaches: ...
4
by: Peted | last post by:
Hello this is the click event method of a radio button private void radioButton1_Click(object sender, EventArgs e) { }
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.