Results 1 to 4 of 4
  1. #1
    Danielt949 is offline Novice
    Windows 11 Office 365
    Join Date
    Jul 2023
    Posts
    13

    Combobox not populating

    Good evening all.

    Can someone please have a look at my project. For some reason, it does not matter what i do, my combo box will not populate with query, It keeps giving a blank.

    Ive even tried copy and pasting from another working query and changing a few things and it still wont work.



    The form i am needing looked at is Frm_New_Defect
    The function should be....
    1. Select "Saraji" from Location combobox, this then populates "Asset Type" combobox (Working perfectly)
    2. Select "Drill" from Asset Type combobox, This then SHOULD populate the "Category" combobox
    3. Category combobox should populate using Asset Type combobox as the criteria. (This is the part that returns only blank results)


    To filter this information, i am using the table Tbl_Categories, Adding Asset Type and Category into the query, filtering the Asset type criteria using the Asset type combobox on Frm_New_Defect.

    Can someone please have a look and see where i am going wrong. I dont understand as there are a couple similar query using the Tbl_Categories as its base information and they are working perfect.

    Please also understand i am not too familiar with the use of the SQL sides of things, generally using the query wizard as this is "Normally" doing what i need of it for now.

    Cheers.
    CMMS-2.zip

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Run the query first.
    Does that produce any data?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    I tried to look at it. Almost every time I switch your form from design to form view the db crashes. What I did find is that if you remove the reference to the category combo in the query and replace it with the number 1 it works. I suspect that you need to add the CategoryID from table categories and make that the first field in the query. Then your category combo should work.

    All of your combos seem to be retrieving the wrong fields. Don't use the text values like "Saraji" - use the pk fields from those tables (the autonumber id fields).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Everywhere I've looked, you're getting your combo values from the wrong tables and/or fields. Example - location combo should get list rows from location table. You hide id column and show location name column. User picks Saraji and the combo "stores" ID 1. Location ID values should be a long integer field in the next table, right beside that table's ID field. So table asset location should store the value of 1, not Saraji.

    I think you need to review db normalization to understand what I'm trying to say (and not doing a great job of it).
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 17
    Last Post: 03-17-2020, 06:10 PM
  2. Replies: 4
    Last Post: 02-24-2020, 05:53 PM
  3. Replies: 3
    Last Post: 05-16-2013, 08:21 PM
  4. Subform not populating from ComboBox
    By DMJ in forum Forms
    Replies: 3
    Last Post: 03-25-2013, 04:20 PM
  5. Form / combobox not populating
    By Auracle in forum Forms
    Replies: 7
    Last Post: 09-20-2011, 11:01 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