473,385 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to lookup either value in a two column combo box?

Greetings-

I can't seem to find an answer on this one. Is it possible to lookup values in either of two columns in a combo box in Access?

The idea is this: I have a combo box that displays an item number and an item description from an items table in the database. I'd like to give the user the option to type in a value from either one of these and go to the correct entry in the combo box. So, if they know a portion of the item name, they can enter that, or if they know the item number they can enter that. The item number gets captured and the form will display relevant data.

I realize that I can put two different combo boxes on the form, but it would be elegant to have it all in one.

Thanks!
Nov 29 '10 #1
2 4247
Stewart Ross
2,545 Expert Mod 2GB
Hi. The data entry part of the combo is restricted to just one column, no matter how many columns you have in its underlying record source (or displayed when you drop down the row selector). Users cannot make entries in more than one column, so it is not possible to use a combo directly for what you propose.

It is of course possible to provide the user with a textbox into which they can type an item number or part of the description, then use custom-designed VBA code to search your underlying recordset for partial matches, but this does not help you with your request re the combos.

If you want to use a single combo you could provide the user with an option group to select the type of entry, changing the recordsource of the combo in code in response to a change in the selection made.

There are always ways to do this kind of searching and matching, but as users can only enter data into one part of a combo this is not the answer in your case.

-Stewart
Nov 29 '10 #2
I figured as much, but it was worth a shot. I'll just but a text box next to the combo box with something like "Or enter any portion of the item description:". Thanks for the quick response!
Nov 29 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Diane Yocom | last post by:
Has anybody ever seen or written code for ASP that would mimic Access' multi-column combo box? Specifically, I have a drop down box that lists about 100 five-digit codes. Each of these codes has...
3
by: Alienz | last post by:
Anybody? This is probably a very simple question. I am just testing this on my own. I have 2 tables: Table name:fields Employer: Employer Number (primary key), Employer Name Employee: SIN,...
8
by: Lyn | last post by:
Hi, Can anyone tell me how the initial value displayed in Combo Box is determined when a form is opened? I am loading the dropdown from one field ("CategoryName") of a table, with "ORDER BY ". ...
1
by: Fujitsu | last post by:
Dear all, How can I have a multi-column combo box, that means more than 1 display member ? Thank you.
0
by: gerry | last post by:
I want to populating an asp list box from a simple access lookup list (single column not a table.)I don't want to create tables just for lookups as the values will be descriptive only and will...
6
by: CindyH | last post by:
Hi Does anyone know how to create a multi column combo box from the same table? Thanks, Cindy
1
by: sangram | last post by:
how to select a default value of combo box in run time, i have select some value from database ,depending on this i have to set the value of combox box... advance thanks..
5
by: sensreview | last post by:
Hello, I need help in selecting a value from combo list thru one lookup table and update different table on MS access form. For eg; I have a lookup table of usernames, I need to use this...
1
by: sathyan8294 | last post by:
what is vb.net code for search the value in datagrid by select the value in combo box using vb.net windows application.
0
by: questionit | last post by:
I have a value in Combo Box. If combo box is expanded, i want to display the current value in its window when its opened. I have tried doing it, but its value doesn't appear in its window. Is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.