View Full Version : Doesn't recognise values as on the list in a combobox


FISHiEE
01-24-2005, 08:45 AM
Hi,

I have a table of records, with one field of the records a combobox populated by a select query based onanother table.

My problem ism that it doesn't seem to recognise any of the values as on the list, though deleting one character and then replacing it results in the value being accepted with no problems.

This is a database I have inherited (Cheers predecessor!), the table is populated with a few thousand records and scrolling through this table results in an error message on this field for every record and is making displaying data on this form a nightmare! Anyone know of the cause or of a quick fix?

I don't know the history of this table unfortunately.

Cheers in advance

John

Pat Hartman
01-24-2005, 08:51 AM
Open the table in design view.
Click on the Lookup tab for the field in question. Is a "lookup" defined?

FISHiEE
01-24-2005, 08:54 AM
THanks for helping. There is a lookup table defined as follows:

SELECT Products.ProductID, Products.ProductDescription, Products.ProductName FROM Products;

Bound Column is column 1, Column count is 3 with the width of column 1 set to 0. I think this is fine right?

FISHiEE
01-24-2005, 08:56 AM
Also I notice that when trying to sort the table into alphabetical order I get a "type missmatch" error message.

FISHiEE
01-24-2005, 09:08 AM
Compact and repair seems to have fixed the sorting problem. It now seems that only some of the records in the table have this problem.

Pat Hartman
01-24-2005, 07:29 PM
Remove the lookup. It is what is causing the confusion. The query really returns the numeric id because that is what is stored in the table. It only shows you the text value in certain cases.

When you need to show the text value, as on a report, use a query that joins the main table to the lookup table as the RecordSource for the report.

FISHiEE
01-25-2005, 01:59 AM
THanks for the help. The problem was in fact corrupt data. For all records causing the problem, simply deleting the last character and then replacing it would remove the error. Weird!