the text you entered isnt an item on the list

N

nishkrish

i created a combo box with row source type Table /Query, Row Source SELECT
[CustomerTbl].[CUSTOMERID], [CustomerTbl].[CustomerName] FROM [CustomerTbl];
thats the query i saved the form but when i open in view and try to type it
shows error

The text you entered isnt an item on the list

Please help

Thanks
 
R

Rick Brandt

nishkrish said:
i created a combo box with row source type Table /Query, Row Source
SELECT [CustomerTbl].[CUSTOMERID], [CustomerTbl].[CustomerName] FROM
[CustomerTbl]; thats the query i saved the form but when i open in
view and try to type it shows error

The text you entered isnt an item on the list

If you are typing something that is in the list then check the AutoCorrect
property of the control. It might be using spell-check to change your valid
entry into an invalid one.

If you are typing something that is NOT in the list then stop doing that :)
That looks like a ComboBox where you show the name but store the ID and
typically than means the bound column (the ID) is hidden. With that setup
you must enter only items that are in the list. You cannot deviate as you
can with a single column ComboBox.
 
N

nishkrish

Rick you mean to say when i creat query i shouldnt select customer id column,
and it will work.
--
Nisha P


Rick Brandt said:
nishkrish said:
i created a combo box with row source type Table /Query, Row Source
SELECT [CustomerTbl].[CUSTOMERID], [CustomerTbl].[CustomerName] FROM
[CustomerTbl]; thats the query i saved the form but when i open in
view and try to type it shows error

The text you entered isnt an item on the list

If you are typing something that is in the list then check the AutoCorrect
property of the control. It might be using spell-check to change your valid
entry into an invalid one.

If you are typing something that is NOT in the list then stop doing that :)
That looks like a ComboBox where you show the name but store the ID and
typically than means the bound column (the ID) is hidden. With that setup
you must enter only items that are in the list. You cannot deviate as you
can with a single column ComboBox.
 
R

Rick Brandt

nishkrish said:
Rick you mean to say when i creat query i shouldnt select customer id
column, and it will work.

No. If you need to relate a record in (whatever table this is your form is
based on) to your customers table then saving the CustomerID as a foreign
key in this table is absolutely the correct way to do it. BUT...this means
that you can only store entries for which you already have an entry in your
Customers table.

If you need to make an entry that is not in your customers table then you
should provide a way for new Customers to be added to the customers table
from this form. If you want to allow "any old text entry" in this field
then there is no reason to use a ComboBox pulling data from the Customers
table.
 
N

nishkrish

Hi sorry for bothering you i know it should be annoying but i am trying to
learn access cause i am trying to take a project and dont want to look dumb
when i take it.

Any ways do you think its a good idea to use Text Box instead of Combobox
actually i am trying to build a database looking at Service Call Managment
Templet and order managment database.
 
R

Rick Brandt

nishkrish said:
Hi sorry for bothering you i know it should be annoying but i am
trying to learn access cause i am trying to take a project and dont
want to look dumb when i take it.

Any ways do you think its a good idea to use Text Box instead of
Combobox actually i am trying to build a database looking at Service
Call Managment Templet and order managment database.

It depends on the rules of your database. Lets take a look at couple of
examples.

A form Orders with Subform LineItems. The main form contains all the header
information for an order and the subform contains all of the individual
items ordered (item, qty, price, etc..)

In the main Order form is a place to enter the CustomerID of the Customer
placing the order. Typically there would be a separate table containing all
data for Customers and this would have a CustomerID or CustomerNumber field.
There could be a ComboBox on the Order form that displays Customer Names but
which stores the CustomerID similar to what you are doing.

In this scenario a user would not be able to enter an order for a
non-existent customer so deviating from the names in the list is simply not
allowed. Any time a ComboBox is set up to "show one value while storing
another" the Limit-To-List is required to be enforced because there is no
way for the user to enter a non-existent value for the hidden column that he
cannot even see. Sure they could enter a customer "Name" that is not in the
list, but what would be the ID value for such an entry? It would not exist
so that is simply not allowed.

Now consider another less formal example. Let's say you have a database for
tracking players in a golf tournament. In the area for entering the
player's name you have a ComboBox that shows the names from previous
tournaments. You have this because there are a lot of repeat players and
having the list saves you some keystrokes, but you will also have some
players who are playing in their first tournament and are therefore not in
the list of choices. In that case deviating from the list is perfectly
okay. The ComboBox is merely a convenience rather than a tool to limit what
are allowable entries.

In the second scenario there is no PlayerID in a hidden column. There is a
single column that contains the player's names. With that kind of ComboBox
setup you can choose to enable Limit-To-List or choose NOT to depending on
your preference and requirements. With a ComboBox that stores a hidden
column's value you have no choice. Limit-To-List is always in place.

So for your database you have to decide. Is the ComboBox a mere convenience
to eliminate typing entries that are in the list or is it a tool to limit
entries to "Valid" choices being provided by another table? If the former
then the ComboBox should have a single column storing the actual text that
you see and then you can choose to turn Limit-To-List off. If the latter
then you leave it as it is and whenever you need to make an entry that is
not in the list you will first have to edit the table that is the source of
the list and add the entry there. Then you can return to this form and use
that new entry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top