Re: Force a limit to number of rows

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Jan 16, 12:36 pm, Rich K <Ri...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
I want to limit the number of rows in a table for demonstration purposes. I
seem to recall that this can be done in the advanced properties of the table
in the validation Rule but I can't recall the syntax.

I'd suggest you define a Jet CHECK constraint on the table e.g.
something like:

ALTER TABLE MyTable ADD
CONSTRAINT we_know_where_you_live
CHECK (3 >= (SELECT COUNT(*) FROM MyTable AS T2));

The Access user interface does a stupendous job of hiding CHECK
constraints from users, to the point where Microsoft haven't even
documented them in the Help (or anywhere else, in fact), and should
baffle most casual users ;-)

Jamie.

--

.



Relevant Pages

  • Re: Verbose functional languages?
    ... I can see how that can happen, but, honestly, I don't recall ever been ... tripped by that in SML, ... I agree that SML's syntax could be improved. ... ever discussing SML's syntax with anyone whose opinions regarding the ...
    (comp.lang.functional)
  • Re: Does Hunters Mark work?
    ... I find alot of my macros on the class forums, and tweak them a bit to my ... I can't recall all the syntax when I'm here at work, ...
    (alt.games.warcraft)
  • Re: Control cannot fall through from one case label (case 115:)
    ... Doesn't Pascal have some sort of "using" syntax? ... "Using" has an entirely different meaning. ... As far as I can recall, there's no "Using" in Pascal, and in VB.NET it's the same as in C# at the end). ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: History of Comment Style & Names
    ... this syntax is quite useful when you want to embed some ... > data in a source file that doesn't consist entirely of Lisp syntax. ... > debugging output where it will be available when I next work on the ...
    (comp.lang.lisp)
  • Re: Two questions about character strings ...
    ... Dick Hendrickson writes: ... I don't even recall what the f95 interp ended up saying about ... one thing that the f2003 syntax now allows is a ...
    (comp.lang.fortran)