Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Mar 2001
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo Box Hell (Access 2000, SR-1)

    I'm a newbie with a combo box problem. I can't get a combo box to find a record on my form based on the value I selected in the combo box. After many struggles, I decided to simplify things to try to isolate my problem. I created a new form, containing all the fields of the table I want to use. The form tested out fine, ie, it displays all the records in the table, by using the navigation bar, etc.
    Then I added a combo box, using the wizard, and selected the option "Find a record on my form based on the value I selected ...:" The field I display there is unique (case number) although it is not the key field (if that matters.)

    When I enter a value into the combo box, the following happens:
    1. the Visual Basic Immediate window opens;
    2. MS Visual Basic pops up an error message: "Compile error. Can't find project or library."
    3. When I clear the error message, I get another message: "This command will stop the de######."
    4. And the case I specified by case number in the combo box is NOT displayed.

    In my book this all looks so straightforward! How have I offended the database deities? <img src=/S/igiveup.gif border=0 alt=igiveup width=31 height=23>

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    You might want to post the code from the combo box's AfterUpdate event.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Hi Charles,
    It sounds like there might be a problem with missing references. Would you please check a couple of things?:
    While viewing the code in the coding window, hit the F2 key to bring up the Object Browser. Its topmost combo box contains a list of Projects and Libraries that your application is referencing. It probably will contain: Access, ADODB, stdole, VBA, and the name of your application. Next choose Tools --> References from the menu. You should see a corresponding checkmarked entry for each Library listed in the Object Browser except for your application's name. If any of them are missing, your references need fixing. As you highlight each selection note the path and name of the file (.olb, .tlb, or .dll) at the bottom of the reference dialog box. For the combobox wizard code the most likely missing library is either Access or VBA. Microsoft Access 9.0 Object Library should point to C:Program FilesMicrosoft OfficeOfficeMSACC9.olb. Your path may be different; you may have to browse for it. Visual Basic for Applications on my machine points to C:Program FilesCommon FilesMicrosoft SharedVBAVBA6 Sorry, I can't see the whole name on my screen so not sure which file it is.

    Good luck!

  4. #4
    New Lounger
    Join Date
    Nov 2001
    Location
    United Kingdom
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    I always get the can't find library query when I have forgot to check DAO 3.6 in the references (Why is this nor always checked anyway as almost anything you do in Access 2000 seems to need it).

    HTH

    James

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Combo Box Hell (Access 2000, SR-1)

    DAO is the object model for Access through 97. From Access 2000 forward, the default object model is ADO, so you have to set the DAO reference yourself if you want to keep using DAO code. If you learn ADO, you'll find that you rarely need the DAO object library. When you do, it's easy enough to turn it on. According to Microsoft, DAO will continue to be supported for backward compatibility, but they won't be adding to it going forward.
    Charlotte

  6. #6
    New Lounger
    Join Date
    Mar 2001
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Dottie and James (Charlotte too!) thanks for your messages, but I was unable to act on them, because there's no code. I simply added a combo box to the form I want to use, and told the Combo Box Wizard to create a "Find a record ..." combo box. I didn't write code to implement it, nor did I build a procedure. The AfterUpdate propery of the combo box just says "[Event Procedure]".

    I created the same kind of combo box in another database, and it works as advertised. Believe me, I am
    Stumped in San Francisco

  7. #7
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Charles,
    If you click on the ellipsis .... next to the [Event Procedure] of the AfterUpdate property, it should open a code window to the Visual Basic editor to see the code that the Wizard wrote for you. That is where you can check Tools --> References to make sure that all the appropriate references are set.

  8. #8
    New Lounger
    Join Date
    Mar 2001
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Dottie,
    Thanks for your help. You obviously know your way around here, and I hope I don't wear you out, because I ** don't ** !
    When I clicked the ellipsis in the AfterUpdate property, it opened up a blank screen in the Immediate window. There were NO lines of code at all.

    When I clicked F2 to start the Object Browser, nothing came up. I was able to see Tools, Reference. Here's what was checked:
    Visual Basic for Applications; Microsoft Access 9.0 Object Library; OLE Automation; Microsoft ActiveX Data Objects2.1 Library; MISSING: MS Windows Common Controls - 2.60; Windows Media Player; MS Office Web Components 9.0; Microsoft DA) 3.6 Object Library; utility, and Standard OLE Types.

  9. #9
    Star Lounger
    Join Date
    Nov 2001
    Location
    Illinois, USA
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Hmmm, it seems like your Visual Basic Editor behind Access is behaving oddly. Anyway, there are still a few things you can try. First priority is fixing your references since one did come up marked "MISSING". There is a Knowledge Base Article that explains how this can break all the code and cause the error message you have gotten: http://support.microsoft.com/support/kb/ar...s/Q160/8/70.asp You can try to resolve it by unchecking the MS Windows Common Controls Reference in the reference window, unless you are using those controls in your project. Usually, that particular reference comes from adding additional tools to the toolbox, I think. As for the missing views in your VB environment, here are some things to try: If you are seeing only the Immediate Window when you go to the VB environment after clicking the ellipsis in AfterUpdate you can try either the F7 key or View --> Code to see if you can get a code window showing your objects and events. If you are lucky enough to have that appear, choose the combobox name (combobox1?) from the leftmost dropdown, then AfterUpdate from the rightmost dropdown. Any code appear? To try to get the Object Browser to appear, can you choose View --> Object Browser from the menu, or does nothing arrive on screen? Good Luck!

  10. #10
    New Lounger
    Join Date
    Mar 2001
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Dottie,
    Late yesterday I discovered why I was only seeing the VB Immediate pane -- I needed to drag down the rest of the window. (insert smilie for profanity here) I feel equal parts stupid and relieved. I really appreciate the help you have been giving me, and now that I can see the code that the wizard wrote I will get back to you later today. It is tremendously comforting to me to know that there is someone to talk to as I try to learn the rudiments of database and Access. Thanks again.
    <img src=/S/yep.gif border=0 alt=yep width=15 height=15>

  11. #11
    New Lounger
    Join Date
    Mar 2001
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo Box Hell (Access 2000, SR-1)

    Finally! <img src=/S/fanfare.gif border=0 alt=fanfare width=31 height=23> Dottie, I followed your suggestion to uncheck the missing MSCommon Controls Reference, and bingo! it works good, like a combo box should.

    I'd like to thank everybody, especially Dottie, for great help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •