Multiple Checkbox Options

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Cuteako
    New Member
    • Oct 2008
    • 8

    Multiple Checkbox Options

    Hi To all,

    I'm new here in bytes, I would like to ask for your help on the database the i'm working on. Here are some details
    Code:
    Name: ________                       Covered Date:__________
    #    Process   Mon Tue Wed Thur  Fri    Remarks    Description  
    1       A      Chekboxes      txtbox
    2       B      Chekboxes      txtbox
    3       C      Chekboxes      txtbox
    4       D      Chekboxes      txtbox
    5       E      Chekboxes      txtbox
    6       F      Chekboxes      txtbox
    7       G      Chekboxes      txtbox
    That needs to compute/total the number of checkbox ticked for each process for covered period inputted (weekly basis).
    I'm having problem in connecting the checkbox to the tables in access and the codes that will compute the checkboxes.

    I will appreciate all the help that I can get.....
    Thanks!!!
    Skiedg
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32653

    #2
    You don't give much detail of your problem and it's not clear what you're having trouble with. Can you clarify the question.

    Comment

    • Cuteako
      New Member
      • Oct 2008
      • 8

      #3
      My problem is first how to connect multiple checkbox in a table.
      How to sum the checkbox that are ticked for the covered period given.
      The description of the form is there are task to be completed weekly mon-fri.
      then the user will tick the task that she/he have done.

      Fields:

      a.Employee ID
      b.dates covered.
      c.checkbox
      d.remarks

      Thank you very much for your assistance....

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        Originally posted by Cuteako
        My problem is first how to connect multiple checkbox in a table.
        Each CheckBox is bound to a different (Yes/No) field within the table.
        Originally posted by Cuteako
        How to sum the checkbox that are ticked for the covered period given.
        What defines the period? All fields in a single record? A particular Yes/No (CheckBox) field across all, or even a specified range of, records?

        NB. After reading your explanation (which comes after this question) it is clear they should be multiple Yes/No fields in the record. This isn't reflected in your record layout though.
        Originally posted by Cuteako
        The description of the form is there are task to be completed weekly mon-fri.
        then the user will tick the task that she/he have done.

        Fields:

        a.Employee ID
        b.dates covered.
        c.checkbox
        d.remarks
        Ah, some explanation at last, but how can a single CheckBox (c) cover Monday to Friday?

        Comment

        • Cuteako
          New Member
          • Oct 2008
          • 8

          #5
          -What defines the period? The user will input the covered period. For example
          Start Date: 11/3/2008
          End Date:11/7/2008

          -Each task will have 5 checkboxes to reflect the monday to friday task.

          -I did try to connect the checkboxes to the table using yes/no in the properties ''Control Source" however after connecting the checkbox becomes disable.

          Thank you again......

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32653

            #6
            Originally posted by Cuteako
            -What defines the period? The user will input the covered period. For example
            Start Date: 11/3/2008
            End Date:11/7/2008
            I'm thinking more of how it is defined within the form.
            Originally posted by Cuteako
            -Each task will have 5 checkboxes to reflect the monday to friday task.
            This seems contradictory to the statement made in post #3 (quoted in my previous post). This needs to be clarified.
            Is it one or the other? It's important (critical) to know this.
            Originally posted by Cuteako
            -I did try to connect the checkboxes to the table using yes/no in the properties ''Control Source" however after connecting the checkbox becomes disable.
            Connecting is done by setting the Control Source property of each CheckBox item to the (or one of the - depending on the actual design) name of the boolean (Yes/No) field in the table.

            Comment

            • Cuteako
              New Member
              • Oct 2008
              • 8

              #7
              A.I'm thinking more of how it is defined within the form.
              - Textbox for Start Date
              - Textbox for End Date
              This is is for the covered period.
              B. This seems contradictory to the statement made in post #3 (quoted in my previous post). This needs to be clarified.
              Is it one or the other? It's important (critical) to know this.
              - Sorry but I forgot to indicate that each task has multiple checkboxes
              -5 to be exact for each task.
              C.Connecting is done by setting the Control Source property of each CheckBox item to the (or one of the - depending on the actual design) name of the boolean (Yes/No) field in the table.
              -Yes I did create a table with Yes/No field in the table and did try to connect it but the checkbox become unable.

              Thank you for your patience and understanding.

              Comment

              • missinglinq
                Recognized Expert Specialist
                • Nov 2006
                • 3533

                #8
                I've deleted your latest, duplicate thread on this problem. This note will bump this thread back up to the top of the queue. In the future, please don't post duplicate threads. If, after a reasonable time, your problem hasn't been solved, or appears to not be attracting attention, add a note yourself. This will bring it back to the top of the queue, and all of the previous questions/answers will be part of it. Simply reposting your question, as you did, gives no one the benefit of NeoPa's questions or your replies.

                Linq ;0)>

                Moderator

                Comment

                • Cuteako
                  New Member
                  • Oct 2008
                  • 8

                  #9
                  Hi Everyone,

                  I really need help on this project; I will give more details so you could understand it more.

                  The database if for task monitoring (weekly). Employees will log every last day of the week to record what task have they done for the week.

                  Name: Start Date:
                  Employee ID: End Date:

                  Task Mon Tue Wed Thur Fri
                  1 < > < > < > < > < >
                  2 < > < > < > < > < >
                  3 < > < > < > < > < >
                  4 < > < > < > < > < >
                  5 < > < > < > < > < >

                  < > = checkbox
                  I created 3 tables already;
                  1st is for list of task
                  2nd is for task completed where in I used yes/no for Mon-Fri.
                  3rd is for list of employees with their employee ID’s

                  I already connect the first row of checkbox in the table of task completed however when I try to check the 2nd row of the task the value of the 1st row defaulted and when I try to change it it doesn’t work how do I go about it

                  And also I need to sum the checkboxes according to task, employee and by dates also.

                  I hope someone can help me with my office project.
                  I will really appreciate any help that you could give.

                  Thank you so much in advance.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32653

                    #10
                    I'm sorry I've been a little tied up during the last week and haven't had time to look at this problem. I hope to find time shortly to give this some more attention. Thank you for your patience.

                    Comment

                    • Cuteako
                      New Member
                      • Oct 2008
                      • 8

                      #11
                      Thank you for your time.
                      Hope to hear you soon..

                      Comment

                      • PianoMan64
                        Recognized Expert Contributor
                        • Jan 2008
                        • 374

                        #12
                        Originally posted by Cuteako
                        Thank you for your time.
                        Hope to hear you soon..
                        Dear Cuteako:

                        It is very clear to me what it is that you're trying to do, the problem is that what you're concept and the model that your trying to do with are totally incompatible with each other.

                        For example, The reason for the table only have one day, with a completed checkbox is so that you can see when the particular item was completed?

                        Since you're using the form to display multi-records on a form that supports only 1 record at a time, this is where the rub is.

                        To teach you what you need to know, would take a great deal of time to teach, sine you're new to VBA.

                        Think of it this way, you can either redesign your form to allow a list of projects in, say a list box that they can click on and highlight, and then click some button to indicate that they are complete.

                        this would then replace what you currently have on your form with something that would allow them to look at pending projects, and then you can tie a click event to a button that would see which items are selected on the ListBox Control and then update each of those records with a DateTime Stamp or a date, or whatever you wanting in the date field.

                        To be able to do what you're talking about you would have to create an event for each and every check_box, then have it locate that record that is assign to that checkbox and locate the Project, and then update it based on which check_box was clicked on.

                        Talk about a great deal of code.

                        Not my idea of a good time. If you would like any code examples of what I'm talking about, please feel free to let me know, or some here in the forum would be more than happy to answer any questions.

                        Just keep in mind that you have to explain exactly what you're trying to do and how you want it to work. You don't need to know all the nitty-bitty details, but just the overall concepts and then that gives you what you need in order to create what it is that you want.

                        Hope that helps,

                        Joe P.

                        Comment

                        • NeoPa
                          Recognized Expert Moderator MVP
                          • Oct 2006
                          • 32653

                          #13
                          Originally posted by Cuteako
                          Hi Everyone,

                          I really need help on this project; I will give more details so you could understand it more.

                          The database if for task monitoring (weekly). Employees will log every last day of the week to record what task have they done for the week.

                          Name: Start Date:
                          Employee ID: End Date:

                          Task Mon Tue Wed Thur Fri
                          1 < > < > < > < > < >
                          2 < > < > < > < > < >
                          3 < > < > < > < > < >
                          4 < > < > < > < > < >
                          5 < > < > < > < > < >

                          < > = checkbox
                          I created 3 tables already;
                          1st is for list of task
                          2nd is for task completed where in I used yes/no for Mon-Fri.
                          3rd is for list of employees with their employee ID’s

                          I already connect the first row of checkbox in the table of task completed however when I try to check the 2nd row of the task the value of the 1st row defaulted and when I try to change it it doesn’t work how do I go about it

                          And also I need to sum the checkboxes according to task, employee and by dates also.

                          I hope someone can help me with my office project.
                          I will really appreciate any help that you could give.

                          Thank you so much in advance.
                          From this post it does become clear that you have some problems with your design. Read what Joe has to say on the matter as it's helpful. Also check out (I'd bookmark it) Normalisation and Table structures.

                          As far as the simple question of adding across the number of True checkboxes is concerned, you can use code similar to the following (using your own control names of course) :
                          Code:
                          With Me
                            intSomeVal = IIf(.chkMon, 1, 0) + _
                                         IIf(.chkTue, 1, 0) + _
                                         IIf(.chkWed, 1, 0) + _
                                         IIf(.chkThu, 1, 0) + _
                                         IIf(.chkFri, 1, 0)
                          End With
                          On a continuous form (as you seem to have) this will only apply to the currently selected record.

                          NB. While I provide this answer, it's more important that you realise that the structure of your database must "fit". Otherwise you will be forever fighting the design, instead of having it work naturally for you.

                          Comment

                          • FishVal
                            Recognized Expert Specialist
                            • Jun 2007
                            • 2656

                            #14
                            Hello, gentlemen.

                            @Cuteako.

                            Dear Cuteako,
                            I quite agree with NeoPa as for pointing you to Database Normalization article.
                            Normalization is a crucial point in database design and should never be traded off to suit table structure for interface implementaion simplicity.
                            I agree with PianoMan too - Access doesn't have a "native" mechanism to edit such kind of data stored in normal tables in a way you want. That doesn't mean it is impossible at all, it will require coding to add desired functionality to what Access has built in.

                            Here I will attach a simple example with the following features:
                            • Form based on crosstab query. Crosstab query is not updateable - so, VBA code behind MouseDown events of form controls modifies source table directly.
                            • Employee is predefined as the first in the correspondent table and week is predefined as that starting from #11/9/2008#. When you get aquainted with the design you will be able to workup these two features.


                            Regards,
                            Fish
                            Attached Files

                            Comment

                            • Cuteako
                              New Member
                              • Oct 2008
                              • 8

                              #15
                              Hi Everyone,

                              I will study my forms, i think i really need to recontruct it.

                              Thank you so much for your inputs.
                              I really appreciate it.

                              Hi PianoMan64 ,

                              Can you give me some sample code of your suggestions.

                              Thank you so much everyone for you help, I hope this will not be the last.....

                              = )

                              Comment

                              Working...