Use a form to add data

J

Jim Robinson

I have read a lot about using a form to display data from a table. Can a
form also be used to add data to a table?
If the answer is yes, how do I create a drop down list of 5 cities from
which to select one to add to the "city" field in a table.
 
C

Chris Reveille

If when you designed the table you used a combo box for the
field city then it will carry ovedr to the form. If not
add a combo box to the form.

Chris
 
P

PC Datasheet

Hi Jim,

Forms are used to add data to a table, edit data in a table and display data
from a table or query. You need a table of cities that looks like:
TblCity
CityID
City

Create a query based on TblCity co you can alphabetize the cities. The query
will have these fields:
CityID
City
Set the sort on City to ascending.

Open your form in design view. Click on the toolbox button at the top of the
screen, select combobox from the list of tools and draw the combobox on the
form. Select the combobox, open properties and go to the Data tab. Set the
Row source property to your query based on TblCity. Set the Bound Column
property to 1. Bo to the Format tab. Set the Column Count property to 2 and
the Column Widths property to 0;1.5. Your combobox will now display the
cities in alphabetical order in the list and when you select a city, the
combobox will have the value of CityID. When the current record is saved,
the value of CityID will be saved to the table your form is based on.
 
F

fredg

I have read a lot about using a form to display data from a table. Can a
form also be used to add data to a table?
If the answer is yes, how do I create a drop down list of 5 cities from
which to select one to add to the "city" field in a table.

Answered elsewhere.
Please do not multi-post. If you feel you must post the same question
to more than one newsgroup (and it's seldom necessary), cross-post by
adding each additional newsgroup in the To Newsgroups: box, separated
by a comma.
This way an answer in one newsgroup will be seen in each of the
others. More readers will see the response and learn, and less time
will be spent on duplicate answers.

See Netiquette at http://www.mvps.org/access

It's a great site to visit anyway.
 

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