Data Entry

M

Marlita

1. I have a main form that has various subforms in it.
2. I have tables that I have not converted to forms, and these tables only
serve as reference tables, like CityID. This table only has two fields:
CITYID which is AutoNumbered and the Name of the City.
3. In my main form, I only enter #'s. So if I need to enter Los Angeles, I
find Los Angeles in my CITYID table, find out that LA's cityID number is 434,
so I enter 434 in my main form.

My question:
When I enter 434 in my main form, I would like the words "Los Angeles" to
appear in a cell next to it so that I can make sure I put in the right number.

How do I do that?
 
D

Dale Fye

The easiest way is to use a combo box on your form, rather than a textbox.

I assume that your CityID table contains the CityID and the CityName. If
that is correct, create a combo box on your form. Set it's control source to
the field in your main forms recordset that matches (it is probably CityID as
well, but may not be).

2. In the RowSource property (data tab) of the combo box, select the CityID
table. Then, if you want them to show up in alphabetical order, you will
probably need to click on the ... to the right of the RowSource and edit the
query that pops up, to sort by the CityName field. Then save the query (I
use the name of the form and control, something like qry_frm_Main_cbo_CityID).

3. Next, set the combo boxes Column Count property to 2
4. Set the combo boxes Columnwidths property to: 0; 2.5
You may or may not need 2.5 inches to display the CityName

Now, when you open the form, and start typing the name of the city in the
combo box, it should automatically move to the first name that matches all of
the characters you have typed in. So you don't have to lookup the # anymore.

--
HTH
Dale

email address is invalid
Please reply to newsgroup only.
 
J

John W. Vinson

1. I have a main form that has various subforms in it.
2. I have tables that I have not converted to forms, and these tables only
serve as reference tables, like CityID. This table only has two fields:
CITYID which is AutoNumbered and the Name of the City.

If your cities are all in the same state, and you'll never go out of state,
this might be ok... but city names are NOT unique. I live in Parma. It happens
to be the small town in Idaho, not the middling city in Ohio - but if all I
had was city names there's be no way to tell.

Note also that your wording "tables that I have not converted to forms" is
evidence that you're misunderstanding what forms are and how they work. You
can't "convert a table to a form". The data stays in the table, and only in
the table; a Form is just a tool, a window onto the data in the table which
lets you work with that data.
3. In my main form, I only enter #'s. So if I need to enter Los Angeles, I
find Los Angeles in my CITYID table, find out that LA's cityID number is 434,
so I enter 434 in my main form.

My question:
When I enter 434 in my main form, I would like the words "Los Angeles" to
appear in a cell next to it so that I can make sure I put in the right number.

How do I do that?

As posted in another thread....

Users should never need to enter, or even SEE, the numeric CityID. They
certainly should NOT be required to look up a city ID on a sheet of paper.

Use a combo box as suggested. That way the user sees "Los Angeles" and the
computer sees 434, and they both go away happy.
 

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