Limiting Number of Records

S

Steve Cartnal

I'm using Access 02 and want to limit a table to a single record. I can't
seem to locate a setting anywhere for this and have looked in help and on
here and am finding nothing. Can this be done?
 
J

John Vinson

I'm using Access 02 and want to limit a table to a single record. I can't
seem to locate a setting anywhere for this and have looked in help and on
here and am finding nothing. Can this be done?

One sneaky way to do so is to put a validation rule on the Primary Key
that it must be equal to 1.

Can't add a new record with 1 in that field, since it would violate
the constraint that primary key is unique; can't add a new record with
any other value because it would violate the validation rule.

John W. Vinson[MVP]
 
S

Steve Cartnal

Thanks, John. I'll give that a shot.

I used to talk to you about Access on CompuServe a few years back. Glad to
see you're still around. You were always quite helpful.
 
J

John Vinson

Thanks, John. I'll give that a shot.

I used to talk to you about Access on CompuServe a few years back. Glad to
see you're still around. You were always quite helpful.

Good to see your font again. I've been gone from CServe for quite a
while now.

John W. Vinson[MVP]
 
J

Joe Mills

sneaky is right but i like it! can you also set it for a range of numbers,
say 1-5?
 
J

John Vinson

sneaky is right but i like it! can you also set it for a range of numbers,
say 1-5?

Sure. Use a validation rule such as
= 1 AND <= 5

and an Integer or Long Integer datatype (so they can't sneak in
3.1415926535).

John W. Vinson[MVP]
 

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