Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121

    combo box blank

    I have a combo box based on Table/Query as follows:
    Select Distinct Assessment.[Assessment No],Assessment.[COO Officer]FROM Assessment;
    It displays duplicates COO Officer. If I remove the Assessment No field, the combo box is blank.


    How do I fix this to just show distinct COO Officer?
    I have ready many posts but don't seem to find an answer that works. I do have Unique Values set to Yes.

  2. #2
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    Can you post the database so we can look at it?

    Dave

  3. #3
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    here is the database, please see the frmAssessment to view the Select Officer combo box at top of form. Thank you!
    Attached Files Attached Files

  4. #4
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    Your table structure can be better. I think you should have a table for the COO name, which you have, then another for Assessments they have completed, which is similar to the Assessments table you have but slightly different. The assessments table should be a list of all possible assessments, description, and a foreign key of CooID_PK (Primary Key of Officer Table.

    You should get in the habit of Naming the Primary Key as a Unique Name for each table. The Assessments Table should the have a Field called CooID_FK and a type of Number so you can set up the relationship between the 2 tables, This will make construction Queries, Forms & reports easier for you in the future, and make additions far easier too if new Assessments are added later.

    I am sure others will have similar input, I will work on what I would recommend while others have a chance to take a look.

    Thanks

    Dave

  5. #5
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    I believe I have got the combo boxes ( or new ones I created) working. Take a look at the Copy of frmAssessment and select the Date then the officer and see if this is what you want? Other code on the form will have to be modified accordingly but I wanted to make sure this is the behavior you wanted first.

    CONOPS Assessments11.zip
    Thanks

    Dave

  6. #6
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Dave, thank you for working on this. I don't see these combo boxes doing anything different then they did before. I can get them to list each date and each officer, however, I cannot get them listed distinctly. It appears they are not using the table structure you mention in your first response where you said I should have a table for the COO name, then another for Assessments they have completed, which is similar to the Assessments table you have but slightly different. The assessments table should be a list of all possible assessments, description, and a foreign key of CooID_PK (Primary Key of Officer Table.
    What am I missing?

  7. #7
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    I don't want users to have to know the date in order to narrow down the officer. I want users to be able to search assessments by date or by officer.

  8. #8
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    I didn't change the table structure in what I sent back, but I would advise it if it were my database. I the original file you attached, I could get bot combo boxes to give results, just multiples because there are multiple dates and multiple instances of officers because of the way the table are structured.

    My changes list the multiple dates as your original but then only list the Officers that are in the Table for the date choosen

    Dave

    Dave

  9. #9
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Would you change the data structure as you suggest so I can see what I need to do to get distinct dates and officer in separate combo boxes?

  10. #10
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    Do you want just 1 date if there are multiple entries and then a list of Officers that have entries on that date?

    Dave

  11. #11
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Yes, if filtering by date first. But I would also like to be able to filter by Officer independent of date. Once filter criteria is selected I would like to see all the relevant assessments.

  12. #12
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    I suggest you open the first file you sent to me, it was working the way you described in both combo boxes I believe, at least how I am understanding what you want. Open the one in your first attachment in this post.

    Dave

  13. #13
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    Dave, The way I expect these combo boxes to work is to display in the drop down distinct dates or distinct officers and not duplicates of each. I also expect it to actually filter just for the assessments for the date selected or officer selected. What it does is returns the first assessment for that date or officer but doesn't just return those specified. For instance, there are a total of 14 assessments in the database, three of which are dated 3/28/19. When I select 3/28/19 in the date combo box, it returns an assessment with that date but then the next assessment is not the next one dated 3/28/19, it is still returning 1 of 14. Using filter by form filters exactly like expected when selecting date or officer or anything else. Is there a way to automate filter by form so the user doesn't have to remember advanced, toggle, etc? Or, I was interested in your suggestion for better table setup in order for combo boxes to work accurately in my database.

  14. #14
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    smg,

    The last file I sent I believe gives you what you want if I am understanding you correctly, maybe I am not. Just look at the 2 combo boxes boxes I added, not the form below, I haven't done anything with that, so it doesn't update anything, just concentrate on the combo boxes.

    Dave

  15. #15
    smg is offline Competent Performer
    Windows XP Access 2010 64bit
    Join Date
    Apr 2019
    Posts
    121
    The file you sent shows duplicates in the date field, does not filter for just those dates and the Officer drop down is blank

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

Similar Threads

  1. Lock Value in Combo Box if Non-Blank
    By ErikAE in forum Forms
    Replies: 4
    Last Post: 08-29-2014, 11:23 PM
  2. Replies: 11
    Last Post: 11-28-2012, 04:29 PM
  3. Combo Box defaults to Blank
    By jimmonator in forum Forms
    Replies: 13
    Last Post: 05-02-2011, 01:28 PM
  4. Blank Data to Combo
    By dlewicki in forum Access
    Replies: 10
    Last Post: 01-14-2010, 10:07 AM
  5. Blank combo boxes
    By ROBBO in forum Forms
    Replies: 3
    Last Post: 01-06-2010, 10: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