Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 11th, 2006, 08:35 PM
campbellwarren@gmail.com
Guest
 
Posts: n/a
Default set a limit to the number of rows allowed in a table

Does anyone know how I could limit the number of rows allowed in a MS
Access table... want to limit it to 1.

  #2  
Old March 11th, 2006, 09:35 PM
salad
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

campbellwarren@gmail.com wrote:[color=blue]
> Does anyone know how I could limit the number of rows allowed in a MS
> Access table... want to limit it to 1.
>[/color]
From a form, in the OnCurrent event, you could have something like
Me.AllowAdditions = (Me.Recordsetclone.recordcount > 0)

  #3  
Old March 12th, 2006, 01:35 AM
Bob Quintal
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

campbellwarren@gmail.com wrote in
news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
[color=blue]
> Does anyone know how I could limit the number of rows allowed
> in a MS Access table... want to limit it to 1.
>[/color]
Create an autonumbe field. set the table validation property to
[field]=1, Replace [field] with the actual name of your field.


--
Bob Quintal

PA is y I've altered my email address.
  #4  
Old March 12th, 2006, 04:35 AM
baonks@gmail.com
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

use TOP function

  #5  
Old March 12th, 2006, 10:45 PM
David W. Fenton
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

Bob Quintal <rquintal@sympatico.ca> wrote in
news:Xns9783CD7517162BQuintal@207.35.177.135:
[color=blue]
> campbellwarren@gmail.com wrote in
> news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
>[color=green]
>> Does anyone know how I could limit the number of rows allowed
>> in a MS Access table... want to limit it to 1.
>>[/color]
> Create an autonumbe field. set the table validation property to
> [field]=1, Replace [field] with the actual name of your field.[/color]

I wouldn't use a table-level validation rule, but a field-level rule
on the Autonumber field, and make it <=10 or whatever the limit on
the number of records you want to limit it to.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #6  
Old March 12th, 2006, 10:45 PM
David W. Fenton
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

"baonks@gmail.com" <baonks@gmail.com> wrote in
news:1142137159.165403.313490@j33g2000cwa.googlegr oups.com:
[color=blue]
> use TOP function[/color]

That will work in SQL, but has nothing to do with the original
question, which is about limiting the number of rows that can be
added to a table.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #7  
Old March 12th, 2006, 11:35 PM
Bob Quintal
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9784B1B1E9BE4f99a49ed1d0c49c5bbb2@127.0.0. 1:
[color=blue]
> Bob Quintal <rquintal@sympatico.ca> wrote in
> news:Xns9783CD7517162BQuintal@207.35.177.135:
>[color=green]
>> campbellwarren@gmail.com wrote in
>> news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
>>[color=darkred]
>>> Does anyone know how I could limit the number of rows
>>> allowed in a MS Access table... want to limit it to 1.
>>>[/color]
>> Create an autonumbe field. set the table validation property
>> to [field]=1, Replace [field] with the actual name of your
>> field.[/color]
>
> I wouldn't use a table-level validation rule, but a
> field-level rule on the Autonumber field, and make it <=10 or
> whatever the limit on the number of records you want to limit
> it to.[/color]

How can you set a field validation rule for an autonumber?
There's no property for that in the design grid. (ACC2000)


--
Bob Quintal

PA is y I've altered my email address.
  #8  
Old March 13th, 2006, 01:35 AM
David W. Fenton
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

Bob Quintal <rquintal@sympatico.ca> wrote in
news:Xns9784B894673F9BQuintal@207.35.177.135:
[color=blue]
> "David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
> news:Xns9784B1B1E9BE4f99a49ed1d0c49c5bbb2@127.0.0. 1:
>[color=green]
>> Bob Quintal <rquintal@sympatico.ca> wrote in
>> news:Xns9783CD7517162BQuintal@207.35.177.135:
>>[color=darkred]
>>> campbellwarren@gmail.com wrote in
>>> news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
>>>
>>>> Does anyone know how I could limit the number of rows
>>>> allowed in a MS Access table... want to limit it to 1.
>>>>
>>> Create an autonumbe field. set the table validation property
>>> to [field]=1, Replace [field] with the actual name of your
>>> field.[/color]
>>
>> I wouldn't use a table-level validation rule, but a
>> field-level rule on the Autonumber field, and make it <=10 or
>> whatever the limit on the number of records you want to limit
>> it to.[/color]
>
> How can you set a field validation rule for an autonumber?
> There's no property for that in the design grid. (ACC2000)[/color]

You're right -- my brain fart.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
  #9  
Old March 13th, 2006, 02:55 AM
Bob Quintal
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

"David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
news:Xns9784CF480F900f99a49ed1d0c49c5bbb2@127.0.0. 1:
[color=blue]
> Bob Quintal <rquintal@sympatico.ca> wrote in
> news:Xns9784B894673F9BQuintal@207.35.177.135:
>[color=green]
>> "David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
>> news:Xns9784B1B1E9BE4f99a49ed1d0c49c5bbb2@127.0.0. 1:
>>[color=darkred]
>>> Bob Quintal <rquintal@sympatico.ca> wrote in
>>> news:Xns9783CD7517162BQuintal@207.35.177.135:
>>>
>>>> campbellwarren@gmail.com wrote in
>>>> news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
>>>>
>>>>> Does anyone know how I could limit the number of rows
>>>>> allowed in a MS Access table... want to limit it to 1.
>>>>>
>>>> Create an autonumbe field. set the table validation[/color][/color][/color]
property[color=blue][color=green][color=darkred]
>>>> to [field]=1, Replace [field] with the actual name of your
>>>> field.
>>>
>>> I wouldn't use a table-level validation rule, but a
>>> field-level rule on the Autonumber field, and make it <=10[/color][/color][/color]
or[color=blue][color=green][color=darkred]
>>> whatever the limit on the number of records you want to[/color][/color][/color]
limit[color=blue][color=green][color=darkred]
>>> it to.[/color]
>>
>> How can you set a field validation rule for an autonumber?
>> There's no property for that in the design grid. (ACC2000)[/color]
>
> You're right -- my brain fart.
>[/color]
Actually, after thinking about it, you don't need an autonumber,
just an int. set the default value to 1, the primary key to the
field, and the validation rule to allow only the one number.



--
Bob Quintal

PA is y I've altered my email address.
  #10  
Old March 13th, 2006, 08:55 PM
David W. Fenton
Guest
 
Posts: n/a
Default Re: set a limit to the number of rows allowed in a table

Bob Quintal <rquintal@sympatico.ca> wrote in
news:Xns9784DA854EE3ABQuintal@207.35.177.135:
[color=blue]
> "David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
> news:Xns9784CF480F900f99a49ed1d0c49c5bbb2@127.0.0. 1:
>[color=green]
>> Bob Quintal <rquintal@sympatico.ca> wrote in
>> news:Xns9784B894673F9BQuintal@207.35.177.135:
>>[color=darkred]
>>> "David W. Fenton" <XXXusenet@dfenton.com.invalid> wrote in
>>> news:Xns9784B1B1E9BE4f99a49ed1d0c49c5bbb2@127.0.0. 1:
>>>
>>>> Bob Quintal <rquintal@sympatico.ca> wrote in
>>>> news:Xns9783CD7517162BQuintal@207.35.177.135:
>>>>
>>>>> campbellwarren@gmail.com wrote in
>>>>> news:1142108625.573777.19070@j52g2000cwj.googlegro ups.com:
>>>>>
>>>>>> Does anyone know how I could limit the number of rows
>>>>>> allowed in a MS Access table... want to limit it to 1.
>>>>>>
>>>>> Create an autonumbe field. set the table validation[/color][/color]
> property[color=green][color=darkred]
>>>>> to [field]=1, Replace [field] with the actual name of your
>>>>> field.
>>>>
>>>> I wouldn't use a table-level validation rule, but a
>>>> field-level rule on the Autonumber field, and make it <=10[/color][/color]
> or[color=green][color=darkred]
>>>> whatever the limit on the number of records you want to[/color][/color]
> limit[color=green][color=darkred]
>>>> it to.
>>>
>>> How can you set a field validation rule for an autonumber?
>>> There's no property for that in the design grid. (ACC2000)[/color]
>>
>> You're right -- my brain fart.
>>[/color]
> Actually, after thinking about it, you don't need an autonumber,
> just an int. set the default value to 1, the primary key to the
> field, and the validation rule to allow only the one number.[/color]

Well, that works for a single-record table, but fails for any other
number of records.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles