Solved

Creating an uneditable combobox that still allows text entry with autocomplete

Posted on 2004-10-21
237 Views
Last Modified: 2008-02-01
Here is my problem.  

I have a form in my MS Access DB that shows a current part number and its associated details.  I currently have the part number in a combobox, when you select the part that you want the details are shown in the fields below.  

What I would like to have is that I can type a part number (or a portion of it, with autocomplete) and hit enter, and have the part details shown below.  Currently when I make the combobox editable, such that I can type text into it, I instead end up changing the part number for the record currently shown.  Otherwise my combobox works as expected, you can click the down arrow, select a part number, and the details are displayed correctly.

Any thoughts/Recommendations?

-R
0
Question by:ShadowedOne
    4 Comments
     
    LVL 11

    Expert Comment

    by:Jokra_the_Barbarian
    Double check your combo box properties. Make sure that the "Limit to List" property is set to "YES".
    0
     

    Author Comment

    by:ShadowedOne
    "Limit to List" is set to "Yes".  Which is working correctly.  However this does not prevent me from changing the part number to that of another part in the DB.

    Thanks for the help.
    0
     
    LVL 11

    Accepted Solution

    by:
    I think I understand what's happening. Here's what you need to do...

    1. View the properties for your part number combo box.
      a. On the data tab, the "Control Source" should be blank. If there is a value there, delete it.
    2. On the Event tab, create an [Event Procedure] for the "After Update" event for the combo box.
      b. Within this event, paste code similar to the following:
                Me.Filter = "[Part Number] = " & Me.Combo0
                Me.FilterOn = True

    You were experiencing problems because the combo box was bound to the table field.

    0
     

    Author Comment

    by:ShadowedOne
    That worked.   I ended up not using the VB code, but removing the "Control Source" reference worked perfectly.

    Thanks much for your help!

    -R
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: MongoDB Object-Document Mapper for NodeJS

    NodeJS (JavaScript on the server) is awesome, but some developers get confused about NoSQL when it comes to working in Node with MongoDB (NoSQL database). Do you need a better explanation of how to use Node.js with MongoDB? The most popular choice is the Mongoose library.

    It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
    A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
    Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    913 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now