• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 246
  • Last Modified:

Creating an uneditable combobox that still allows text entry with autocomplete

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
ShadowedOne
Asked:
ShadowedOne
  • 2
  • 2
1 Solution
 
Jokra_the_BarbarianCommented:
Double check your combo box properties. Make sure that the "Limit to List" property is set to "YES".
0
 
ShadowedOneAuthor Commented:
"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
 
Jokra_the_BarbarianCommented:
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
 
ShadowedOneAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now