Page 1 of 4 1234 LastLast
Results 1 to 15 of 56
  1. #1
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57

    Voter Registration & Vote Counting

    I belong to a car club, and we run car shows. Participants bring their vehicles, and register them. They are then given a number, and a voting slip. They post the number on their vehicle. All participants then will vote for 5 vehicles. When the ballots are turned in, the counting begins. This is a time consuming effort.

    I want to attach a bar code to each registration slip, and a duplicate bar code to the ballot. At or after registration, the registration bar code will be scanned into a database. The car number will be entered into a field. Other fields may be used for identification, but not necessary.



    The ballots will be scanned, and the 5 vehicle #s will be manually entered into 5 fields. The database then can be queried for the top 10 car numbers.

    I have done a lot of programming, and am familiar with PHP, but no database experience.

    I suppose that my first steps will be to build a table. Assuming that I have a USB wireless scanner, how do I get the scanner to open the database to the right row, based on the bar code?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    youd have your tRegistration table with Barcode as the key,
    fields:
    Barcode (not sure if you are doing both barcodes and car#)
    Car#
    firstN
    LastN
    etc...

    then a tVotes table to hold the votes/barcode entries.
    BarCode

    make a form for barcodes, a textbox on the form bound to table tVotes
    scan barcodes into form.

    then make a count query on this table, qsCountVotes:
    join this table to the tRegistration,
    select Count(Barcode) from tVotes , tRegistration where tVotes.Barcode = tRegistration.Barcode

  3. #3
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    Thanks, I'll try it.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    If I come to the car show but don't have a car to enter, can I still vote for 5 cars?

  5. #5
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    No, you have to register a car in order to get a ballot. The registration fee is usually $15.00. I suppose that you could pay the fee, and get a ballot.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You should start out by using paper & pencil/whiteboard/cardboard/Excel/etc to design your table structures/fields.
    Try manually entering data to see how things relate. Only then, get on the computer to start creating tables.


    You know programming, so forgive me if this is too basic:

    I stole the following from a post by orange - it is better than anything I could write:
    ---
    "I recommend you create a narrative in simple terms about your proposed database and application. You don't start building a database by identifying a Form with 3 buttons. Now, that may very well be your initial user interface, but that is not the database. It is not as easy as many think to clearly describe WHAT your business is/will be. Consider the "things" involved(entities), the particular characteristics of each(attributes) that are important for your business and how these things relate to one another (relationships). After you have the narrative, you can use pencil and paper (or whiteboard or cardboard or ...) to develop and refine a data model. Create some test data and vet your model.
    <snip>

    <snip>
    I see too many people, who have the latest HW and Access, jumping in head first think the software will build the database. They have multiple issues and can't access the data required for X and/or Y, and typically it is an issue of basic table and relationship design. Their next "rationalization" is " I've got too much invested to go back and correct the design...". Don't get yourself in that predicament.

    You have to do the analysis, build a plan, set priorities......Since you have the business, you know the processes better than anyone, so analysis should be second nature-- and providing you are familiar with database concepts -- designing the database should be an iterative process and a good learning experience for you. The data model and testing/vetting will result in a blueprint for your database. Review, test, adjust, and repeat until you get the results you expect. People are here and willing to help."
    ---

    See the attached text file for links to normalization sites

    ---
    Some suggestions:
    Use only letters and numbers (exception is the underscore) for object names.
    Do not use spaces, punctuation or special characters in object names.
    Do not use look up FIELDS, multi-value fields or calculated fields in tables.
    Do not begin object names with a number.
    ------------------
    Bad field name: "RA#" (has the hash mark")
    Good/better field names: "RANum", "RA_Num", "RA_Number"

    Bad field name: "Bagged Y/N" (has space and slash")
    Good/better field names: "BaggedYN", "Bagged_YN", "Bagged_Y_N"
    ------------------
    Attached Files Attached Files

  7. #7
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    I may be jumping ahead on this, but I generated 2 Forms, tRegistration & tVote. Then I wrote a Subroutine in 'C'(I'm familiar with), and converted it to VB. This is how I would handle two tables in 'C'. My problem here is that I don't know how many BarCodes will be generated. It should be less than 500. 'C' will let me use >0 as a limit in a For/Next loop, but VB needs an end number.

    Sub Count()
    For tVote.BarCode = 1 To 500
    For tRegistration.BarCode = 1 To 500
    If tVote.Car1 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    If tVote.Car2 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    If tVote.Car3 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    If tVote.Car4 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    If tVote.Car5 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    Next
    Next
    End Sub

  8. #8
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    I added some ElseIf statements to break the loop, if tRegistration.Count was incremented.

    Sub Count()
    For tVote.BarCode = 1 To 500
    For tRegistration.BarCode = 1 To 500
    If tVote.Car1 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    ElseIf tVote.Car2 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    ElseIf tVote.Car3 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    ElseIf tVote.Car4 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    ElseIf tVote.Car5 = tRegistration.Car_Number Then tRegistration.Count = tRegistration.Count + 1
    Next
    Next
    End Sub

  9. #9
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It is better to get the table structure nailed down before trying to figure out how to total the votes.
    Do you have the tables created?


    Wouldn't it be much easier to use a totals query to get the vote totals?

  10. #10
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    Quote Originally Posted by ssanfu View Post
    It is better to get the table structure nailed down before trying to figure out how to total the votes.
    Do you have the tables created?


    Wouldn't it be much easier to use a totals query to get the vote totals?
    I have the tables created.

    I am not sure how to use a totals query.

  11. #11
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664

  12. #12
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    I don't think that Total Queries will do what I need. There are some votes that are not counted.

    How do I link my VB Module to the Tables? I get an error when I Run my VB code, because it can't find tVote.Car_Number from the tVote table.

  13. #13
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    How can I reference an element in a Table, so I can access it in a Function? The compiler doesn't like tVote.Car_Number in an argument.

    Public Function Vote_Count(tVote.Car_Number As Integer)

  14. #14
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't think that Total Queries will do what I need.
    I don't know why a totals query wouldn't give the total votes by car....


    How can I reference an element in a Table, so I can access it in a Function?
    Two options:
    1) In the UDF, open a query to get the car_number
    2) Use the DLOOKUP() function.


    Would you post your current dB with a few records??? I am really curious as to why the totals query won't give you the correct results...

  15. #15
    Dan Lee is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jan 2017
    Posts
    57
    I got it all linked to the point that it tries to run my Vcount Module. That doesn't run because VB doesn't compile this expression

    Public Function VCount(tVote.Car_Number As Integer, tRegistration.Car_Number As Integer, TRegistration.Count As Integer, tVote.Car_1 As Integer, tVote.Car_2 As Integer, tVote.Car_3 As Integer, tVote.Car_4 As Integer, tVote.Car_5 As Integer) As Integer

    There is some syntax error in the declaration of the arguments.

Page 1 of 4 1234 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. 30 day registration for access
    By CHEECO in forum Access
    Replies: 7
    Last Post: 06-05-2016, 12:31 PM
  2. Using access registration details
    By BSJoJaMAx4 in forum Access
    Replies: 7
    Last Post: 10-05-2015, 06:05 PM
  3. registration database
    By hodagh in forum Queries
    Replies: 7
    Last Post: 11-05-2012, 12:52 PM
  4. Registration of Attendees
    By camende in forum Programming
    Replies: 1
    Last Post: 06-30-2010, 03:47 PM
  5. Registration Form
    By nengster in forum Forms
    Replies: 0
    Last Post: 02-16-2009, 04:22 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums