Limit table to 1 record

R

Rob LMS

I have a database that includes a "settings" table. The settings table
should only have 1 record. I have tried to design the form used to enter the
settings to not allow the user to create additional records but it sometimes
occurs. One such way to "accidentally" add a record is to hit the page-down
key when on the form.

Is there a way to set a table property to not allow more than one record?

Thanks in advance.
 
D

Duane Hookom

You could add an autonumber primary key to the table and set a table
Validation Rule to only allow records with an autonumber value of the
current value in your table.
 
S

Sharkbyte

Add a RecordID field, set the value to '1'. Then add an IF statement to your
data load function checking for a record with an ID of 1. If it exists, the
load function fails.

HTH

Sharkbyte
 
R

Rob LMS

great idea. Thanks.

Duane Hookom said:
You could add an autonumber primary key to the table and set a table
Validation Rule to only allow records with an autonumber value of the
current value in your table.
 

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