473,327 Members | 2,016 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,327 software developers and data experts.

Combo Search pulling incorrect field

I am trying to create a combo box search on the form with the Part Number but for some reason it’s pulling the Part Number Table’s Primary Key. Can’t figure out why. Any ideas where to start?

FYI- it's a look up field from a table. I'm trying to research how to fix it because I already invested a lot of time.

Thanks,
JT
Jun 5 '08 #1
3 1326
Megalog
378 Expert 256MB
Can you post the code you're using for your search? Specifically the part where it calls on the combo box itself. Also, post the sql you're using for the combo's rowsource. You are probably bound to that table's primary key, but on the combo control, you're displaying a different field. So the combo's .Value property is going to be the selected index number of the table.

So the value you visually select (the unbound data), may not be the value that's being passed to your search function.

If this is the case, you can try using the column feature to get the currently selected unbound data.

me.cboObject.Column([Column # starting with 0],[Row #])

In this example, the first number (1) is the second column #, and the Listindex property provides the currently selected row #.

me.cboObject.Column(1, me.cboObject.ListIndex)

There might be a property that just returns what the selected visible text is, but I cant remember what it is offhand.
Jun 5 '08 #2
Here's the Code:
Expand|Select|Wrap|Line Numbers
  1. SELECT [Material Inventory].[Material Inventory ID], [Material Inventory].[Part Number] FROM [Material Inventory];
Thanks again!
John
Jun 9 '08 #3
NeoPa
32,556 Expert Mod 16PB
John, you need to look, not at the code so much, as the properties of your ComboBox control. Specifically Column Count, Column Heads and Bound Column. I suspect your Bound Column is set to 2 rather than 1, but read up in the Help system to see what they mean and do.

PS. Please remember to use CODE tags when posting code in future.
Jun 10 '08 #4

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

Similar topics

1
by: Anonymous | last post by:
Quick question - I have a form with with many fields on it. I have three combo boxes that are used as search engines (Last Name, City, State). For example, when I open the form, all three search...
3
by: AW | last post by:
Hi all, I have a form (named Offices) with a subform (named Occupants) that connect with the Master/Child Field "office number". I have a combo box that allows a user to pull up a particular...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
4
by: Lauren Wilson | last post by:
A2K I have a combo box that shows the content of a last name field from a table. I use it to locate records in the table form. I can open the form and locate several names quickly by placing...
2
by: Ray Todd Jr | last post by:
I have created form, query and report. In the form I have a Combo Box which pulls the search criteria (SaleStatus) from one of my tables. When I select a status and click on the search button...
1
by: dskillingstad | last post by:
Would appreciate any help I could get I have an unbound search form with various text boxes on it for searching my database. I would like to have a combo box on the search form where the source...
8
by: salad | last post by:
I was wondering how you handle active/inactive elements in a combo box. Let's say you have a combo box to select an employee. Joe Blow has been selected for many record however Joe has left the...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
2
by: puzzled | last post by:
I have "Find" buttons throughout my database, each with focus on a different field (they were created with the wizard, then the focus set to the corresponding field with VB). If i press a find button...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.