Storage of Values

C

CountM

I would like to enter a value or values on a form and have
them saved and available to me each time I open and use
the database. They will be maintained and represent year
and month. I could link the form to a table, but I only
want 1 (only) entry to this table. How do i do this?
 
J

John Vinson

I would like to enter a value or values on a form and have
them saved and available to me each time I open and use
the database. They will be maintained and represent year
and month. I could link the form to a table, but I only
want 1 (only) entry to this table. How do i do this?

You can limit a table to allow only one record by giving it an integer
Primary Key, with a validation rule of

=1

Enter a record with 1 in this field (and the month and year in other
fields). You won't be able to add any new records because they'd
either have 1 in the primary key field, causing a key violation (there
can only be one record for a given PK value), or if you try to add a
record with some other value it will fail the validation rule.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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