• Voting program (vb6, w2000)

    Author
    Topic
    #361422

    I would like to make a small program that gathers people’s votes for a pumpkin carving contest we’re having at work. They will vote on 5 categories. I have made txtBox1, 2,3,4,5 and want them to enter the number of the pumpkin they vote for in each category.

    I know how to make the form and name the boxes etc. but how would i best tabulate the votes in each category. Do i input the data into excel and then count it? What would be the simplist way? Also, how to i prevent them from voting for the same pumpkin in any of the 5 categories. It has to be a different pumpkin in each category. thanks for your help.

    Viewing 0 reply threads
    Author
    Replies
    • #546247

      jha900

      Have you worked with MS-Excel and VBA before? Its very similar to VB, just the Object Model needs to be looked at.

      Link the 5TextBoxes to five columns and then use some MS-Excel functions to come up with the answers.

      I will be willing to help you if you want me to

      Wassim

      • #546252

        ok, so you recommend i do this in excel and have a form box come up so they can vote. how do i supress the excel screen so they only see the form box. I don’t want them to see who’s winning the contest i only want them to hit a SUBMIT button and off they go.

        If i do one row for each person, how can i stop them from entering the same number in any of the 5 category columns? i really appreciate your help. thanks

        • #546253

          jha900

          Its very easy to suppress the worksheet view when the UserForm is displayed. one simple technique is to have the cell background and the font color be the same. You can apply some protection to the worksheet, you can have the input range way way low in rows 56,000 and that will take a lot of time to scroll down that far. You can make the project into an Add-in and add further protection.

          To limit the choices of the second and on textboxes you can have some data validation on these textboxes or better yet you can have combo boxes that will have the list of times dynamically generated based on the previous choice.

          You are welcome.

          Wassim

          • #546259

            The application visible property can be set to fasle, so hiding the actual workbooks/workshets in the case of Excel.

                Application.Visible = False

            or if you are using another application such as VB, then

                Excel.Application.Visible = False

            It would be necessary to execute

                Application.Visible = True

            when finished.

            However, there may be issues if the users are using an instance of XL for other purposes.

            Andrew C

          • #546485

            Ok, I am doing in Excel. When they open my voting.xls, i want the form to appear automatically. How do i do that? Also, can you help me with the code to make sure each txtbox has a different number in it. When they hit the SUBMIT button I can send a msgbox that they have duplicated a vote and they can’t do that. thanks a lot for your help.

            • #546592

              Excel workbooks have event triggered routines, including “Open” (some call them Auto_Open etc), use these automatically display forms.
              Worksheets can be individually hidden.

              Ewan

            • #546902

              I have the form done for my voting excel workbook. How can i make it appear when i double-clock on voting.xls?

              Also, if I have 6 numbers in a row of my voting.xls, how do i check to make sure none are duplicates. For instance,…
              60 43 55 60 17 22

              I can’t allow two cells to have 60 in it. What is the formula to check these cells for duplicates.

              I greatly appreciate the help to this problem. thanks a lot.

    Viewing 0 reply threads
    Reply To: Voting program (vb6, w2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: