Results 1 to 5 of 5
  1. #1
    Emilee is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    2

    Count Combo Box Options

    Hi everybody,

    I'm creating a database to collect time study data for a company. Currently I have a combo box field for each 15 minute segment of the day. The combo box contains 7 different departments from which the employee has to choose (picking the department that 15 minutes was benefiting). For payroll purposes I need to count the amount of times each department is chosen from all the 15 minute combo boxes. Any ideas on how to do this?

    Thanks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    How many comboboxes would that be - 96? There is a field for each segment? This is not a normalized data structure. The aggregate calc you want will not be simple and will likely involve VBA because 96 fields is too many for a UNION query (limit of 50 SELECT lines).
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Emilee is offline Novice
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2015
    Posts
    2
    Yes there are 96 combo boxes. Is there a better way to set this up? I need the employees to be able to pick a department for ever 15 minutes of the day. (Including all hours like 3AM which makes no sense to me!). I just don't know how to approach this. It seems simple but I can't think of how to automate it. Could I group and "count" them by hour and then combine the hours data?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,630
    And how would you suggest to do the grouping and counting on 96 fields? Yes, can do a sum on each field but then adding 96 fields in an expression will probably be impossible. As I said, would likely involve VBA.

    Instead of 96 fields and comboboxes, should be one field. Each selection of department and time period should be a new record. Then aggregate calcs in query will be simple.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Yes there are 96 combo boxes.
    Properly normalized tables rarely exceed even 50 fields. 96+ fields
    suggests that you are "committing spreadsheet", meaning that you are
    storing your data as if you were using Excel instead of using a database.

    Excel spreadsheets are typically short and wide.
    Database tables are typically tall and narrow.

    Your structure is not in 1st normal form: you have repeating fields.

    Not knowing your requirements, I would suggest:

    tblDepartments
    ---------------
    Dept_ID_PK (Autonumber - primary key)
    DeptName (Text)


    tblTimeStudys
    -------------
    TimeStudyID_PK (Autonumber - primary key)
    Dept_ID_FK (Long) ' foreign key - link to tblDepartments
    TimeInterval (Date/Time) ' 9:00 AM, 9:15AM , 9:30AM, ...



    Can 1 time interval benefit more than 1 department? Or can 1 time interval benefit only 1 department?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. My combo box is only showing a few of the options
    By breakingme10 in forum Forms
    Replies: 2
    Last Post: 07-29-2014, 03:29 PM
  2. Replies: 2
    Last Post: 05-20-2014, 10:41 AM
  3. Combo Box Options
    By AnnWalls in forum Access
    Replies: 4
    Last Post: 05-06-2014, 06:06 PM
  4. To count the number of lookup options
    By lizzywu in forum Queries
    Replies: 4
    Last Post: 02-23-2012, 07:47 PM
  5. Restrict Combo Box Options
    By KWarzala in forum Forms
    Replies: 1
    Last Post: 03-03-2010, 04:46 PM

Tags for this Thread

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