473,799 Members | 3,817 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a report based on field values

3 New Member
I've developed a test that results in standard scores from 35 to 99. Now, i need to be able, when a score for a specific scale is, let's say, >=75 and <=84, to have a predefined block of text be placed in a report. And, if the score for that same scale is >=85 and <=94, to have another text box be placed there instead, in the same place in the report. I am no programming guru, but if i'm given a simple example, i think i'd be able to tweak it to what i need. i hope this is possible and that someone will please help me figure this out.

Let's say my table is called mytbl and the field is called delsum, which has the value of 78. i want to be able to have a block of text placed into a report that says something like "When individuals score in such a range, thus and such can be expected, blah blah blah."

PLEASE TELL ME THIS IS POSSIBLE
Mar 9 '08 #1
3 1980
ADezii
8,834 Recognized Expert Expert
I've developed a test that results in standard scores from 35 to 99. Now, i need to be able, when a score for a specific scale is, let's say, >=75 and <=84, to have a predefined block of text be placed in a report. And, if the score for that same scale is >=85 and <=94, to have another text box be placed there instead, in the same place in the report. I am no programming guru, but if i'm given a simple example, i think i'd be able to tweak it to what i need. i hope this is possible and that someone will please help me figure this out.

Let's say my table is called mytbl and the field is called delsum, which has the value of 78. i want to be able to have a block of text placed into a report that says something like "When individuals score in such a range, thus and such can be expected, blah blah blah."

PLEASE TELL ME THIS IS POSSIBLE
There are several methods which you can use to accomplish this, but this is the 1st one that comes to mind. First, a couple of assumptions:
  1. Your Report Name is Report1.
  2. You have a Table named mytbl which contains a Field (INTEGER) named [delsum].
  3. The Record Source for Report1 is mytbl.
  4. Your Report, among other Fields, contains the [delsum] Field and is named the same, namely, delsum.
Time for the fun part!
  1. Create an Unbound Text Box on Report1 and name it txtResults.
  2. Copy and Paste the following Variable Declaration to the General Declarations Section of Report1. The Variable 'must' be Declared as Variant to allow for the possibility of Null Values for [delsum], unless the Required Property of this Field is set to True.
    Expand|Select|Wrap|Line Numbers
    1. Private varTestResults As Variant
  3. Copy and Paste similar code to the Format Event in the Detail Section of Report1:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    2. varTestResults = Me![delsum]
    3.  
    4. If IsNull(varTestResults) Then
    5.   Me![txtResults] = "No Grade Listed"
    6. ElseIf varTestResults >= 96 Then
    7.   Me![txtResults] = "WOW!"
    8. ElseIf varTestResults >= 85 And varTestResults <= 95 Then
    9.   Me![txtResults] = "Great!"
    10. ElseIf varTestResults >= 75 And varTestResults <= 84 Then
    11.   Me![txtResults] = "Good!"
    12. ElseIf varTestResults <= 74 Then
    13.   Me![txtResults] = "EL STINKO!"
    14. End If
    15. End Sub
  4. The code has been tested and is fully functional, let me know how you make out.
Mar 10 '08 #2
Freud52
3 New Member
There are several methods which you can use to accomplish this, but this is the 1st one that comes to mind. First, a couple of assumptions:
  1. Your Report Name is Report1.
  2. You have a Table named mytbl which contains a Field (INTEGER) named [delsum].
  3. The Record Source for Report1 is mytbl.
  4. Your Report, among other Fields, contains the [delsum] Field and is named the same, namely, delsum.
Time for the fun part!
  1. Create an Unbound Text Box on Report1 and name it txtResults.
  2. Copy and Paste the following Variable Declaration to the General Declarations Section of Report1. The Variable 'must' be Declared as Variant to allow for the possibility of Null Values for [delsum], unless the Required Property of this Field is set to True.
    Expand|Select|Wrap|Line Numbers
    1. Private varTestResults As Variant
  3. Copy and Paste similar code to the Format Event in the Detail Section of Report1:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    2. varTestResults = Me![delsum]
    3.  
    4. If IsNull(varTestResults) Then
    5.   Me![txtResults] = "No Grade Listed"
    6. ElseIf varTestResults >= 96 Then
    7.   Me![txtResults] = "WOW!"
    8. ElseIf varTestResults >= 85 And varTestResults <= 95 Then
    9.   Me![txtResults] = "Great!"
    10. ElseIf varTestResults >= 75 And varTestResults <= 84 Then
    11.   Me![txtResults] = "Good!"
    12. ElseIf varTestResults <= 74 Then
    13.   Me![txtResults] = "EL STINKO!"
    14. End If
    15. End Sub
  4. The code has been tested and is fully functional, let me know how you make out.
My Friend!
You are a genius!!!!
It works perfectly. I couldn't be more pleased.
Thank you so much for your expert help.
Mar 10 '08 #3
ADezii
8,834 Recognized Expert Expert
My Friend!
You are a genius!!!!
It works perfectly. I couldn't be more pleased.
Thank you so much for your expert help.
You are quite welcome, Freud52.
Mar 11 '08 #4

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

Similar topics

6
2738
by: gonzalo briceno | last post by:
I have been using phplib for a while and I really like the framework except for form creation. Maybe it is me but I in my opinion there isn't a good way to create forms or should I say, everything else is so well done that the way you create forms seems to be too cumbersome, in particular making it so that a pull down menu selects a value that you assign it. In any case, does anyone know of any php based (or other readily accepted web...
3
3921
by: Ranman | last post by:
Hi all, I have a simple problem that hopefully has a simple solution, but I have yet to figure it out. In a patient database, I have a physician test order form that populates a report that is then printed and mailed out or faxed. It would be nice to have the doc's electronic signature show up on this report, but we have 4 or 5 docs that order tests. So, I would like to use a combo box on this form to select from a
1
17681
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to Create a Dynamic Crosstab Report PRODUCT :Microsoft Access PROD/VER:1.00 1.10 OPER/SYS:WINDOWS
1
2919
by: longtim | last post by:
I have been having endless difficulty creating reports/queries that set any relevent parameters from controls in forms. I am creating an application under access 2003 but will target access 2000. The access file is in access 2000 format. I have a form that will hold the relevent parameters for the query/report that reports the statistics for all job records that match a certain criteria. These are: - A Customer Name.
6
3318
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a parameter query which is the recordsource for the report. The parameter is <=. The query returns the correct amounts upto the date entered (no need for "between" dates here). There are 8 textboxes with dcounts; 2 other boxes Sum some of these
9
3095
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Declare your object variables
3
2187
by: rreitsma | last post by:
I want to create a form that will allow the user to select from a list of available reports and based on a filter limit the records displayed in the report. I have figured out how to access the reports collection to populate a list box containing the report names. The filter I currently have lists some key fields that I think the user may want to filter on. A WHERE string is constructed based on the feilds that the user inputs values into....
0
1401
by: mmueller | last post by:
I am new to reporting services 2005 (reporting in Access for years and older versions of Reporting Services from time to time) and this is probably a dumb question... but I have no internal resources since I am the first to use it so... here you go: I have a report I am trying to recreate, the old one is in a PowerBuilder app and the author is no longer with company. The majority of the report is straightforward, but I am really hung up on...
22
2742
kcdoell
by: kcdoell | last post by:
I have been trying for the last several days to create a query that will give me all of the values I need to create a report. Background: The report is different than anything I have done but I am hoping that for someone out there has. Visually it looks like the following: Product Name__Week 1__Week 2__Week 3__Week 4__Week 5__BudgetGWP__PriorGWP Product 1________45______56_______0_______0_______12_______300_________250__ Product...
0
9543
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10488
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10257
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7567
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5588
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4144
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.