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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • munkee
    Contributor
    • Feb 2010
    • 374

    #16
    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

    Comment

    • Sophie Mess
      New Member
      • Jan 2011
      • 17

      #17
      Yes the record Navigation buttons...

      Comment

      • munkee
        Contributor
        • Feb 2010
        • 374

        #18
        In the form properties area go to "Format" and there should be "Navigation Buttons" in the options, set this to No.

        Comment

        • Sophie Mess
          New Member
          • Jan 2011
          • 17

          #19
          ahh fab thank you!

          Comment

          • ADezii
            Recognized Expert Expert
            • Apr 2006
            • 8834

            #20
            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:
              Code:
              Private Function fCalcS1Credits(bytSemester As Byte)
              Dim ctl As Control
              Dim intS1Credits As Integer
              
              For Each ctl In Me.Controls
                If ctl.ControlType = acCheckBox Then
                  If Mid$(ctl.Name, 4, 2) = "S" & CStr(bytSemester) Then     'Semester 1 only
                    If ctl.Value Then                     'Must be selected
                      'Let's create a Running Total by retrieving the Credits based on
                      'a Course as retrieved from the Check Box's Tag Property
                      intS1Credits = intS1Credits + DLookup("[Credits]", "tblCourses", "[Name] = '" & ctl.Tag & "'")
                    End If
                  End If
                End If
              Next
              
              'Assign Total S1 Credits to the txtS1Credits Text Box
              Me![txtS1Credits] = intS1Credits
            5. In the AfterUpdate() Event of each Semester 1 Check Box, place the following Code:
              Code:
              Private Sub chkS1IntBus_AfterUpdate()
                Call fCalcS1Credits(1)
              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.

            Comment

            • munkee
              Contributor
              • Feb 2010
              • 374

              #21
              Sigh! Adezii you make my solutions look so stoneage good work

              Comment

              • Sophie Mess
                New Member
                • Jan 2011
                • 17

                #22
                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.gotorecor d , , acNext

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

                Thanks again!!

                Comment

                • ADezii
                  Recognized Expert Expert
                  • Apr 2006
                  • 8834

                  #23
                  Thanks munkee, just years and years of practice, and a lot of mistakes along the way! (LOL).

                  Comment

                  • ADezii
                    Recognized Expert Expert
                    • Apr 2006
                    • 8834

                    #24
                    The Check Boxes are not 'Bound', so you cannot simply Save the Record.

                    Comment

                    • Sophie Mess
                      New Member
                      • Jan 2011
                      • 17

                      #25
                      ignore that last post!!

                      Comment

                      • Sophie Mess
                        New Member
                        • Jan 2011
                        • 17

                        #26
                        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!

                        Comment

                        • ADezii
                          Recognized Expert Expert
                          • Apr 2006
                          • 8834

                          #27
                          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

                          Comment

                          • Sophie Mess
                            New Member
                            • Jan 2011
                            • 17

                            #28
                            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????

                            studentfirstnam e = DLookup("First Name", "Student Details", "StudentID= " & Forms![Option Form]!StudentID)

                            Comment

                            • Sophie Mess
                              New Member
                              • Jan 2011
                              • 17

                              #29
                              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?

                              Comment

                              • ADezii
                                Recognized Expert Expert
                                • Apr 2006
                                • 8834

                                #30
                                studentfirstnam e = 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:
                                  Code:
                                  studentfirstname = DLookup("[First Name]", "Student Details", "StudentID= " & Forms![Option Form]!StudentID)
                                3. Is the StudentID a Numeric Value?

                                Comment

                                Working...