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

Selection Problem

1
I have inherited an Access database that was written in VBA and am still an amateur when it comes to VBA. I am tasked with computing a selection criteria based on a number of values that have to be banded or grouped. I have solved the grouping problem but would like assistance on the selection. Here is a sample of what I need to do:
Example:
Values: 37,36,35,33,33,32,31,30,30,25,24,22,22,21,20,17,15 ,10

Values are banded on a 4 integer grouping scale as follows starting with the top score then subtracting 3 from the top for the start of the range.

Band A: (34 - 37) Values: 37,36,35
Band B: (30 - 33) Values: 33,33,32,31,30,30
Band C: (22 - 25) Values: 25,24,22,22
Band D: (18 - 21) Values: 21,20
Band E: (14-17) Values: 17,15
Band F: (7 - 10) Values: 10

I have already written the VBA code to do the banding and updated my table. Now here is the tricky part: Each score is associated with a Level, either 17,15,12,7 or 4. I have a set number that I need to select by Level based on the Value score and band. Now, the Values cannot be selected more than one level above what they currently are, for example: a level 7 cannot be selected for a level 15.
Level 17 =3 selected
Level 15 = 4 selected
Level 12 = 7 selected
Level 7 = 3 selected
Level 4 = 0 selected

Example: If I need 3 to be selected for level 17. all 3 Values in Band A would be selected provided they were at level 15 or above.

Now, If I need 4 to be selected for level 15 and I have 6 values in Band B, I treat all scores equal which are not below Level 12. I then calculate a separate scoring and then choose the hightest from this separate score. The Top 4 would be selected based on this and the remaining 2 would be selected on the next Band C.

Now, If I need 7 selected for Level 12 out of Band C, I already have 2 from the previous and need an additional 5 selected. Since Band C has only 4 values, all are selected provided they are above a Level 7.

Note: Level 4 needs to be automatically default to a value if not selected for Level 7.

I simply keep going until all are selected. I would like to update my table with a Level Value if the score is selected.

Please Help! I thought I could do this in a set of queries but I believe this will require several loops.

My thoughts are that I would first loop through the scores for a level test, then compare the total count per band to the total of my selection, select those that did not meet the level test until I reach my selected number. Any thoughts?
Feb 13 '06 #1
0 1518

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

Similar topics

8
by: lawrence | last post by:
I'm a beginner with Javascript and especially cross-browser Javascript. I got this working in IE, but not in Netscape 7. It seems like, in Netscape, every time I click on a button, the focus shifts...
2
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase();...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
5
by: STeve | last post by:
Hey guys, I currently have a 100 page word document filled with various "articles". These articles are delimited by the Style of the text (IE. Heading 1 for the various titles) These articles...
1
by: 4Ankit | last post by:
Hey guys i am having some trouble with nesting one selection structure within another selection structure. At the moment i am unclear what selection structures are and just need a simple example of...
5
by: Jure Bogataj | last post by:
Hi all! I have a problem (performance issue) with listview. I have implemented an ItemSelectionChange on my listview and put some code in it (I build some toolbar based on selection and update...
4
by: sialater | last post by:
Hello, I realise there are a lot of topics related to this problem but many of what I have found has run cold or unresolved. What I have is an addressbook clone where there are groups which have...
9
by: Brett_A | last post by:
I have a form where the first field is a dynamic drop-down that pulls from a db (Access). The fields associated with the query are task_id, task_name and task_rate. The field has the value of...
2
by: vanditnagar | last post by:
Hi, I am facing the difficulty in the selecting a text on the browser . And highlighting the text. I am using the window.getSelection() to get the object and after...
4
by: Brandon | last post by:
HI all, I am working on a WPF listview that get items through the XMLDataProvider and making a listview with two actual columns and in both CellTemplete XAML in a grid bind more than one snippet...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.