Results 1 to 10 of 10
  1. #1
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7

    Question Combo Boxes

    Hi all.

    I have been trying to add a new combo box into the Downtime Entry Form called components. I have want it to refrence from a previous bombo box on the same form called Equipment Type.

    No matter what I have tried to do I can't get it to work. It just keeps displying empty compo box options.
    I have searched eveywhere and tried several things with no luck.

    Can someone please have a look at it and give me an advice?



    Thanks,

    here is the database.

    SBM DT Database.zip

  2. #2
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Try set the RowSource with a query and Requery the Component combobox, like what you did for the Description combo.

  3. #3
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7
    Quote Originally Posted by stmoong View Post
    Try set the RowSource with a query and Requery the Component combobox, like what you did for the Description combo.

    I did just that but I keep getting black drop down box. I tried it several different ways but I'm still not getting it right.

  4. #4
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    Ok, not sure if this is what you want. I'm assuming you want to list the components in the combo box named "Component" based on the selected value in the combo box named "Equipment Type". The form I'm referring to is called "Downtime Event Entry".

    In the property sheet of the "Component" combo box, under the Format tab, change the Column Count to 3, Column Widths to 0":0":1"

    Under the Data tab, delete the Row Source.

    In the code behind for Equipment_Type_AfterUpdate, add
    Code:
        Me.Component.RowSource = "SELECT ID, Type, Components FROM Component" & _
            " WHERE Type = " & Chr(34) & Me.Equipment_Type.Column(1) & Chr(34)
        Me.Component.Requery
    Previously, the query is trying to compare the Type with the Components, so nothing is returned. There may be further errors in other combo boxes, which you will need to solve them.

  5. #5
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7
    Quote Originally Posted by stmoong View Post
    Ok, not sure if this is what you want. I'm assuming you want to list the components in the combo box named "Component" based on the selected value in the combo box named "Equipment Type". The form I'm referring to is called "Downtime Event Entry".

    In the property sheet of the "Component" combo box, under the Format tab, change the Column Count to 3, Column Widths to 0":0":1"

    Under the Data tab, delete the Row Source.

    In the code behind for Equipment_Type_AfterUpdate, add
    Code:
        Me.Component.RowSource = "SELECT ID, Type, Components FROM Component" & _
            " WHERE Type = " & Chr(34) & Me.Equipment_Type.Column(1) & Chr(34)
        Me.Component.Requery
    Previously, the query is trying to compare the Type with the Components, so nothing is returned. There may be further errors in other combo boxes, which you will need to solve them.
    Thanks for that. That worked briliantly.

    You were right. I have other error comming up now that I have to look at.
    Actually, you might be able to help me.
    When I select something from the Component combo box, I get an error
    "Downtime Database can't find the object'
    .'

    If'
    ' is a new macro or macro group.....
    I'm having troubles identifying the soruce of this.

  6. #6
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    There are some artifacts of a deleted macro. If you go and look at the Event tab, of any event of any control, you will see something like ~TMPCLPMacro when you try to select an event handler.

    Do a compact and repair. Read more here http://www.utteraccess.com/forum/VBA...-t1898162.html

    You might want to clean it up, maybe try decompile and recompile the project.
    http://www.fmsinc.com/microsoftacces.../decompile.asp

  7. #7
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7
    I'm not sure where you can see the ~TMPCLPMacro but I have run both of the compact and decompile procedures you have listed above. I tired them in different order as well but it still has the same problem.

  8. #8
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    If you click on the "Component" combo box on the "Downtime Event Entry" form, go to the Event tab of the Property Sheet. Click on the drop down box next to the On Click event. Mine is showing the ~TMPCLPMacro below [Event Procedure].

    If the decompile and compact/repair doesn't help, then, your best bet is to create a new blank database and import all the objects to the new database.

  9. #9
    MechEngSk is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jan 2013
    Posts
    7
    Yes I have found it. Mine is showing the same.

    I have managed to resolve the issue.

    I used one of the previous back-up versions of the database before I started working on the components drop down box. I made changes in the back up one. It has worked beautifuly...

    I believe the artefacts taht were left behind must be from when I was truying to get the components combo box working with no luck.

    Stmoong, thanks for your detailed help. I would not had been able to fix the database without your help.

  10. #10
    stmoong is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Sep 2011
    Location
    Singapore
    Posts
    108
    You're welcome. Just remember to mark the thread as solved.

    Scroll to the top of this thread and move your mouse over Thread Tools.

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

Similar Threads

  1. Replies: 9
    Last Post: 06-04-2014, 10:45 AM
  2. combo boxes
    By donnan33 in forum Programming
    Replies: 9
    Last Post: 12-22-2011, 01:10 PM
  3. Combo Boxes - Many-to-Many
    By alpinegroove in forum Forms
    Replies: 3
    Last Post: 12-19-2011, 06:38 PM
  4. Combo boxes
    By Nixx1401 in forum Forms
    Replies: 1
    Last Post: 07-19-2010, 06:07 AM
  5. combo boxes
    By thewabit in forum Forms
    Replies: 7
    Last Post: 01-01-2010, 08:51 PM

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