Custom datatypes

A

Angelina

Hi,

I have created an Access Project (.adp -- msde)
and i want to know if it is possible to limit the data
that can appear in a partcular column. i.e. if i have a
coloumn called filmType, how do i ensure that the only
values that can be accepted are Horror, Action and Comedy?

Is there a way to do this while designing my tables
 
S

shannon

You can limit the field's value at the table level. In the
design view of the table, click on the filmType column. At
the bottom of your screen click LookUp tab. Make this
field a combobox. Can't remember the name of the field,
but on this tab there is also a place to store values of
the combobox...enter Horror;Action;Comedy (Might be
separated by commas instead of semis, you may have to try
both). This should work.
 
A

Andy Williams

That won't work in .adp

How about using a check constraint? You can do this in the table's
properties page.

If you have access to Query Analyzer, you can do the following:

ALTER TABLE films

CONSTRAINT CK_filmType CHECK (filmType = 'Horror' OR filmType = 'Action' OR
filmType = 'Comedy')
 

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