Limiting Number of Records

  • Thread starter Thread starter Steve Cartnal
  • Start date Start date
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?
 
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]
 
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.
 
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]
 
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]
 
Back
Top