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

Should I used Cascading Combo Boxes or individual tick boxes? Most effective?

Hi,

I've been tasked to designing a form for 'students' to use to submit which courses to take at school. The courses are split into those for Semester 1 and Semester 2 and 3(max) can be chosen each semester but it does depend on the weighting (could be 2 courses).
However certain courses in S1 and cannot be chosen together, certain courses in S2 cannot be chosen together and certain courses in S2 cannot be chosen if certain ones aren't chosen in S2.

The idea and the coding should be fairly ok...I think however I am trying to determine how to layout the available options:

- Should I use individual tick boxes (as an option group won't allow multiple selection) and then create the coding within the'submit' button

-Or is is possible to use 3 different combo boxes (per semester)and get them to each filter according to which other courses have been selected in the other 1/2 combo boxes????? Or would this be too much work??

Any ideas would be greatly appreciated,

Thanks
Jan 2 '11 #1
31 2058
ADezii
8,834 Expert 8TB
Generally speaking, I prefer the idea of Cascading Combo Boxes as opposed to Tick Boxes in Option Groups, for the following reasons:
  1. Cascading Combo Boxes would list only viable Options based on selections made on previous Combo Boxes. Code would be placed in the AfterUpdate() Event of each Combo Box in order to provide the correct choices for the next Combo.
  2. Tick Boxes would take up more real estate on a Form and would probably be more confusing to the User.
  3. Carefully coded Cascading Combo Boxes could avoid the possibility of having the User click the Submit Button only to have his/her choice(s) rejected due to conflicts. A Submit Button also gives the false impression that all choices are acceptable and that it is only a matter of 'Submitting' them.
  4. This is only an opinion based on limited information and no actual data to go by, so please view it in this context.
Jan 2 '11 #2
Yes I agree with you, I think it would look much neater as well.

The real issue is that I have no idea where to begin with the coding and where to write the coding as well...can you help?

I should add I am a pretty much a beginner on all of this and therefore a combo box does seem slightly daunting!!
Jan 2 '11 #3
ADezii
8,834 Expert 8TB
I will need much more detailed information to get started, so kindly provide the Parameters as well as some Sample Data, what can and can not coexist, etc.
Jan 2 '11 #4
Ok thanks,
This is the information that we have been given:


In your role as an independent IT consultant, you have been asked to tender for a large-scale programming contract. To establish your programming credentials, you have been asked to design and develop an information system, which will be primarily used to capture students’ option choices, for use in a Business School. The system will run on Microsoft Access supported by programmes written in Visual Basic. The requirements specification for the system is as follows:

The system should be designed so that students can automatically select their options from a screen which will indicate to them whether they have broken any of the following selection constraints:

• Each student must select exactly 30 credits worth of modules in both the first and second semesters. The descriptions, credit weightings, and time-tabling arrangements for all the option modules are presented in the table below.

•International Business 2 cannot be selected unless International Business 1 has also been chosen.
•Business Programming 2 cannot be selected unless Business Programming 1 has also been chosen.
•Decision-making and Decision Analysis share some common material so students cannot choose both these options.
•Business Finance and Corporate Finance share some common material so students cannot choose both these options.

•Business Planning and Corporate Strategy share some common material so students cannot choose both these options.

Semester 1:
International Business 1 20
Business Programming 1 20
Decision-making 20
Change Management 10
Business Planning 10
Small Business Issues 10
Decision Analysis 10
Jan 3 '11 #5
Semester 2:

International Business 2 20
Business Programming 2 20
Business Finance 20
Corporate Strategy 10
Career Management 10
Business Ethics 10
Corporate Finance 10

• In addition to the modules, highlighted above, there is also an optional Management Dissertation, which runs across both semesters, and is weighted 10 credits per semester, and therefore 20 credits in total
Jan 3 '11 #6
ADezii
8,834 Expert 8TB
  1. Sophie, this appears to me to be more and more like a School Assignment, is it?
  2. After carefully reading Post# 5, this is much more then just designing a Form to use to Submit which Courses Students take at school. It is actually a complete Information System used to capture Student's Course selections for use in a Business School, along with a series of Constraints both within Semesters and among Semesters.
  3. I do not mind assisting you in the basics, but we will not do the Project for you.
  4. I created a Sample Demo for you which reflects how I feel this System can be developed.
  5. Look closely at the Tables,their structures, the Relationships that exist among them, and the data contained within them.
  6. You will also see, that to the best of my knowledge, no Constraints have been violated as far as the sample data in them.
  7. Look also at the Querys: qryCourseSelectionByStudent/Semester and qryTotalCreditsByStudents/Semester.
  8. From the guidelines listed in Post# 5, as well as the limited number of actual Courses, your Form should be divided into 2 Logical Sections representing Semesters 1 and 2. For each Semester, Check Boxes should be contained within a Logical Group but not in an Option Group where they would be mutually exclusive. They can be placed within a Rectangle Control which can closely mimic an Option Group, but allow for Multiple Selections within the Grouping.
  9. Code in the AfterUpdate() Event of each Check Box can Call a Procedure which will take care of the necessary Validations/Constraints, and make any notifications and adjustments if required.
  10. For now, look at the Attachment, and if you have any questions, feel free to ask.
Attached Files
File Type: zip Student Courses.zip (12.9 KB, 81 views)
Jan 4 '11 #7
Ok great, actually it looks like I am on the right track already then...yes it is for school and don't worry I never thought that you would be doing it for me!! Though obviously that would have been great!!!!

I have already split the two module sections into option groups, and though there is no linkage between them, there are individual grouped within a rectangle.

Thanks for all your help thus far, it's been very useful!

Just to prove that I am doing it on my own I've attached a screen shot of my database to show you!

Sophie
Attached Images
File Type: jpg Module Database.jpg (42.6 KB, 186 views)
Jan 4 '11 #8
ADezii
8,834 Expert 8TB
Looks great so far, Sophie. Just a couple of little pointers that you may/may not wish to use:
  1. Name your Check Boxes so that you can easily identify to which Semester they belong. You could use a naming System such as chkS1... for Semester 1 Courses, and chkS2... for Semester 2 Courses.
  2. Plcae the exact Course Name in the Tag Property of the corresponding Control, as in:
    Expand|Select|Wrap|Line Numbers
    1. Check Box Name    Tag Property of Control
    2. chkS1CngMnt       Change Management
    3. chkS1BusPln       Business Planning
    4. chkS2BusEth       Business Ethics
  3. Now, I'll illustrate the advantages of such an approach. To retrieve a listing of all 'Selected' Semester 1 Courses, along with the Control Name, actual Course Name, and the Total Number of Courses selected:
    Expand|Select|Wrap|Line Numbers
    1. Dim ctl As Control
    2. Dim intCtr As Integer
    3.  
    4. Debug.Print "Control Name", "Course Name"
    5. Debug.Print "------------------------------------------------"
    6.  
    7. For Each ctl In Me.Controls
    8.   If ctl.ControlType = acCheckBox Then          'Is the Control a Check Box?
    9.     If Mid$(ctl.Name, 4, 2) = "S1" Then         'Semester 1 Courses only
    10.       If ctl.Value Then                         'Semester 1 Courses Selected
    11.         intCtr = intCtr + 1                     'Increment Course Counter
    12.           Debug.Print ctl.Name, ctl.Tag
    13.       End If
    14.     End If
    15.   End If
    16. Next
    17.  
    18. Debug.Print
    19. Debug.Print "Number of Semester 1 Courses Selected: " & intCtr
  4. Sample Output based on 3 Courses Selected for a Total Credit of 30, with no Constraints being violated:
    Expand|Select|Wrap|Line Numbers
    1. Control Name  Course Name
    2. ------------------------------------------------
    3. chkS1DecMak   Decision-making
    4. chkS1CngMnt   Change Management
    5. chkS1SmBusIsu Small Business Issues
    6.  
    7. Number of Semester 1 Courses Selected: 3
  5. Let's now say that 1 or more Semester 1 Constraints have been violated. To Clear all Semester 1 Check Boxes only:
    Expand|Select|Wrap|Line Numbers
    1. Dim ctl As Control
    2. Dim intCtr As Integer
    3.  
    4. For Each ctl In Me.Controls
    5.   If ctl.ControlType = acCheckBox Then
    6.     If Mid$(ctl.Name, 4, 2) = "S1" Then         'Semester 1 Courses only
    7.       ctl.Value = False                         'Clear Semester 1 Courses
    8.     End If
    9.   End If
    10. Next
Jan 4 '11 #9
Ok thanks.
I have been attempting the coding this afternoon..I expect I will get stuck somewhere so if I do I might post if on here...if you have any feedback for me!!

Many thanks
Jan 4 '11 #10
ADezii
8,834 Expert 8TB
Not a problem. One additional point is that you may wish to provide some Visual Cue as to how many Credits each Course is worth. You can actually add this info into the Labels for the Check Boxes, as in:
Expand|Select|Wrap|Line Numbers
  1. International Business 2 (20)
  2. Business Planning (10)
  3. etc...
Jan 4 '11 #11
munkee
374 256MB
Did I notice a Loughborough logo there sophie?
Jan 5 '11 #12
Yes I'm already on that!!

Codes going ok (surprisingly!!). But what I would like to do is create a running total under each semester list to show either how many credits are left, or how many are being used and to update itself each time an update is made............any ideas?

I've written the code to calculate the current total, but i've no idea how to get the result to feed into the form or to constantly update?

Thanks!!
Jan 5 '11 #13
munkee
374 256MB
Sophie,

You should be able to use the after update event of the option control to produce a calculation which will then update the running total at the bottom.

This will basically fire the code you place in the event, as the name suggests after each update.

Edit:

After reading up a bit. With your after update event you would need to have it check whether the other checkboxes within the "fake" option group are selected or not. If they are or are not (depending how you want to calc it) selected you can then use this to take values to perform the summation at the bottom.

I expect Adezii will produce a nice function for this though as I am quite basic :p
Jan 5 '11 #14
also i've got to add security features to the database, I've already started on a password section...do you have any other ideas?
Is it possible to turn off the record search at the bottom of the form
is it possible to only allow students access to certain forms (and not tables)
is it possible to allow teachers different access?
Jan 5 '11 #15
munkee
374 256MB
Here is a quick example of the summing I was talking about (attached).

By record search do you mean the record navigation buttons? The ones that let you click through each record using the arrows.
Attached Files
File Type: zip Summing.zip (16.4 KB, 85 views)
Jan 5 '11 #16
Yes the record Navigation buttons...
Jan 5 '11 #17
munkee
374 256MB
In the form properties area go to "Format" and there should be "Navigation Buttons" in the options, set this to No.
Jan 5 '11 #18
ahh fab thank you!
Jan 5 '11 #19
ADezii
8,834 Expert 8TB
Assuming you have been using my suggestions relating to Coding, Naming Conventions, Structure, etc...
  1. Create a Text Box under the Semester 1 Group and Name it txtS1Credits.
  2. Label it appropriately.
  3. Set the Default Value to 0.
  4. Create the following Private Function in your Form's Class Module:
    Expand|Select|Wrap|Line Numbers
    1. Private Function fCalcS1Credits(bytSemester As Byte)
    2. Dim ctl As Control
    3. Dim intS1Credits As Integer
    4.  
    5. For Each ctl In Me.Controls
    6.   If ctl.ControlType = acCheckBox Then
    7.     If Mid$(ctl.Name, 4, 2) = "S" & CStr(bytSemester) Then     'Semester 1 only
    8.       If ctl.Value Then                     'Must be selected
    9.         'Let's create a Running Total by retrieving the Credits based on
    10.         'a Course as retrieved from the Check Box's Tag Property
    11.         intS1Credits = intS1Credits + DLookup("[Credits]", "tblCourses", "[Name] = '" & ctl.Tag & "'")
    12.       End If
    13.     End If
    14.   End If
    15. Next
    16.  
    17. 'Assign Total S1 Credits to the txtS1Credits Text Box
    18. Me![txtS1Credits] = intS1Credits
  5. In the AfterUpdate() Event of each Semester 1 Check Box, place the following Code:
    Expand|Select|Wrap|Line Numbers
    1. Private Sub chkS1IntBus_AfterUpdate()
    2.   Call fCalcS1Credits(1)
    3. End Sub
  6. Now, each and every time you Select/Deselect a Semester 1 Course, the Text Box will be dynamically updated.
  7. I'll leave Semester 2 up to you, since it now can be easily implemented.
Jan 5 '11 #20
munkee
374 256MB
Sigh! Adezii you make my solutions look so stoneage good work
Jan 5 '11 #21
Amazing! Will try it in a second!!

Just finished the bulk of coding...and it seems to work fine! so that's good, only thing i'm slightly stuck on is when I want the record to save and move to a new one, what coding is correct, I used:

docmd.gotorecord , , acNext

which saves the record, but then say's 'delete' on the fields on the new record?!

Thanks again!!
Jan 5 '11 #22
ADezii
8,834 Expert 8TB
Thanks munkee, just years and years of practice, and a lot of mistakes along the way! (LOL).
Jan 5 '11 #23
ADezii
8,834 Expert 8TB
The Check Boxes are not 'Bound', so you cannot simply Save the Record.
Jan 5 '11 #24
ignore that last post!!
Jan 5 '11 #25
Adezii which is the Form's Class Module?...the table with each the the different modules listed or the form to enter module selection?

also if by naming conventions you mean chks1/2 then yes I have!
Jan 5 '11 #26
ADezii
8,834 Expert 8TB
Adezii which is the Form's Class Module?...the table with each the the different modules listed or the form to enter module selection?
In Form Design View ==> View ==> Code
Jan 5 '11 #27
Function isn't working yet but will keep trying..

Also I am trying to populate certain text boxes from the student details table depending on the 'Student ID' inputed from the drop down box. I'm using the following but it doesn't work????

studentfirstname = DLookup("First Name", "Student Details", "StudentID= " & Forms![Option Form]!StudentID)
Jan 6 '11 #28
Also -

Is it possible to populate a field on a form using a value entered at an earlier stage...i.e. at the log in stage?
Jan 6 '11 #29
ADezii
8,834 Expert 8TB
studentfirstname = DLookup("First Name", "Student Details", "StudentID= " & Forms![Option Form]!StudentID)
  1. Is the Table named Student Details?
  2. Is the First name Field actually named First Name, if it is then it must be enclosed in Brackets because of the Space, as in:
    Expand|Select|Wrap|Line Numbers
    1. studentfirstname = DLookup("[First Name]", "Student Details", "StudentID= " & Forms![Option Form]!StudentID)
  3. Is the StudentID a Numeric Value?
Jan 6 '11 #30
1.) yes the table is called student details
2.)yes called first name, in the student details table
3.)student ID looks something like A763828
Jan 6 '11 #31
ADezii
8,834 Expert 8TB
Since StudentID is NOT Numeric, then a change in Syntax should do the trick:
Expand|Select|Wrap|Line Numbers
  1. studentfirstname = DLookup("[First Name]", "Student Details", "StudentID= '" & Forms![Option Form]!StudentID & "'")
Jan 6 '11 #32

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

Similar topics

0
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding ...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
2
by: ShadowHawk | last post by:
Hi Everyone. I've been having a little touble with a form I'm working on. (I'm a MS Access hobbiest). I've set up the cascading combo boxes, which is working, (I took the code from Microsoft) on a...
2
by: SPOILED36 | last post by:
I am building a database to track attendance. I have one main form with multiple subforms. Within one of the subforms name sfrDailyAttendance, I also have cascading combo boxes (cboCategory and...
3
by: buddyr | last post by:
Hello, Yesterday I recieved help with two cascading combo boxes on an access form. I went the link http://www.fontstuff.com/access/acctut10.htm And basically used their first example. Now I...
4
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields...
3
kcdoell
by: kcdoell | last post by:
I have 5 cascading combo boxes on a form. Below is a sample of my vb in the first combo box: Private Sub CboDivision_AfterUpdate() 'When the Division is selected, the appropriate Segment...
7
by: Toireasa | last post by:
Hi, Newbie Access developer here, and my first post on this forum, so I might not get everything right - thanks in advance for your help and your patience! I'm using Access 2007, in XP. I'm...
3
by: MOCaseA | last post by:
I have a record lookup form that has several combo box filters set up. However I noticed a slight problem. The filters are working correctly, but there are now over 2000 entries and when filtering...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.