COMBO BOX PROBLEM

R

Reggie

This Access is tuff to learn.

Today I used the Wizard to make a Bound Combo box in a simple form. Although
the data source (a list of city names) appears in the Combo Box as expected,
I still get an error notice stating:

"The value you entered isn't valid for this field. For example, you may have
entered text in a numeric field or a number that is larger than the
FieldSize setting permits."

This problem has stumped me all day and into the night.

The City Names table only has two fields: City Name ID # (primary key with
autonumber) and City Names (text). The form has one field labeled City Name.

The Combo Box resides in the form I have prepared that primarily uses fields
from the Citizen Name table.

To establish the needed relationship I have included fields labeled City
Name ID # (numeric) and City Name (text) into the Citizen Name table. Both
fields named City Name use 20 character field sizes. City Name field from
the City Name table populates into City Name field of the form I have
prepared. I can not see that text is going into a numeric field or visa
versa. What am I missing?

CITIZEN NAME TABLE
Citizen Name Id # (autonumber & Primary Key)
Citizen Name (text)
field size 20

CITY NAME TABLE
City Name ID # (autonumber & primary key)
City Name (text)
filed size

CITIZEN NAME FORM
City Name (combo box)
Column Width is 0";1"
 
K

Ken Snell

I'm guessing that the Row Source Query has the fields reversed from what you
want (it should return the ID and Name fields in that order), or the Bound
Column of the combo box is not 0 (which it should be), or you have the wrong
field name in the Control Source for the combo box (should be the ID field).

Post the SQL statement of the Row Source query from the combo box and post
what is the bound column of that combo box. Also, post the field name that
is in the Control Source of the combo box.
 
J

John Vinson

This Access is tuff to learn.

Today I used the Wizard to make a Bound Combo box in a simple form. Although
the data source (a list of city names) appears in the Combo Box as expected,
I still get an error notice stating:

"The value you entered isn't valid for this field. For example, you may have
entered text in a numeric field or a number that is larger than the
FieldSize setting permits."

This problem has stumped me all day and into the night.

This means that you're attempting to store a text value (a city name)
into a numeric field.
The City Names table only has two fields: City Name ID # (primary key with
autonumber) and City Names (text). The form has one field labeled City Name.

The label of a control on a form is ABSOLUTELY IRRELEVANT, of course.
What's important is the datatype of the Bound Column of the combo box,
and the datatype of the combo's Control Source field.
The Combo Box resides in the form I have prepared that primarily uses fields
from the Citizen Name table.

To establish the needed relationship I have included fields labeled City
Name ID # (numeric) and City Name (text) into the Citizen Name table. Both
fields named City Name use 20 character field sizes. City Name field from
the City Name table populates into City Name field of the form I have
prepared. I can not see that text is going into a numeric field or visa
versa. What am I missing?

CITIZEN NAME TABLE
Citizen Name Id # (autonumber & Primary Key)
Citizen Name (text)
field size 20

CITY NAME TABLE
City Name ID # (autonumber & primary key)
City Name (text)
filed size

THe City Name field *should not exist* in the Citizen Name table. It's
redundant. Use only the City ID Long Integer field; use *it* as the
Control Source of the combo box. There's no need and no benefit to
storing the city name redundantly in this table; just store the ID
using the combo box, and set the combo's Column Widths property to
display only the city name.
 
R

Rolls

Looks like you have tblPeople and tblCity and you want your DB to be able to
associate a person with a city. So far you have two entity tables but you
don't have a relationship table. The relationship table stores the PKs from
the entity tables into a row in tblPeople-City as FKs for each unique
combination.

This lets you set up a subform to manage the combinations. The subform has
two combo boxes that reference the two entity tables as the respective
rowsource. Each saves only the key value. The result adds one record to
tblPerson-City each time you add a new unique combination.

When you set up a combination in tblPerson_city you might find that you need
to add a new person to tblPerson or a new city to tblCity. At this point
you need functionality to open a new form, add a record to the respective
entity table, return to the subform, and continue to add a record to
tblPerson-City.
 
R

Reggie

Thank you gentlemen. I will try out your recommendations. I really
appreciate your help in my uphill learning adventure.

Reggie
 

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