Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Voting program (vb6, w2000)

    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.

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Voting program (vb6, w2000)

    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
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Voting program (vb6, w2000)

    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

  4. #4
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: Voting program (vb6, w2000)

    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
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  5. #5
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Voting program (vb6, w2000)

    The application visible property can be set to fasle, so hiding the actual workbooks/workshets in the case of Excel. <pre> Application.Visible = False</pre>

    or if you are using another application such as VB, then <pre> Excel.Application.Visible = False</pre>

    It would be necessary to execute <pre> Application.Visible = True</pre>

    when finished.

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

    Andrew C

  6. #6
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Voting program (vb6, w2000)

    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.

  7. #7
    Lounger
    Join Date
    Aug 2001
    Location
    Shropshire, UK
    Posts
    43
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Voting program (vb6, w2000)

    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

  8. #8
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Illinois
    Posts
    552
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Voting program (vb6, w2000)

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •