A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Disable input after 5 entries



 
 
Thread Tools Display Modes
  #1  
Old December 12th, 2007, 04:29 PM posted to microsoft.public.access.tablesdbdesign
Harvard
external usenet poster
 
Posts: 14
Default Disable input after 5 entries

I'm working with 2 tables. One contains Table Reservations, and the second
contains the People that will be sitting at the tables. Is there a way to
disable assigning people to a table after 5 people have been reserved for a
particular table?
  #2  
Old December 13th, 2007, 12:56 AM posted to microsoft.public.access.tablesdbdesign
mscertified
external usenet poster
 
Posts: 835
Default Disable input after 5 entries

Yes there is. If you are assigning people via a form, put a check in the form
(query the table to see how many assigned so far).
In fact, each table could have its own 'max people' and you could stop after
the 'max people' for the table. So you could have different sized tables
taking different numbers of people.

-Dorian

"Harvard" wrote:

I'm working with 2 tables. One contains Table Reservations, and the second
contains the People that will be sitting at the tables. Is there a way to
disable assigning people to a table after 5 people have been reserved for a
particular table?

  #3  
Old December 13th, 2007, 11:23 AM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Disable input after 5 entries

On Dec 13, 12:56 am, mscertified wrote:
I'm working with 2 tables. One contains Table Reservations, and the second
contains the People that will be sitting at the tables. Is there a way to
disable assigning people to a table after 5 people have been reserved for a
particular table?


Yes there is. If you are assigning people via a form, put a check in the form
(query the table to see how many assigned so far).


Isn't a 'forms' approach OT for the 'tables' group g? Regardless,
don't you think that simple data rules such as these should be
enforced using table constraints? I do.

In fact, each table could have its own 'max people' and you could stop after
the 'max people' for the table. So you could have different sized tables
taking different numbers of people.


Good point. Here's a demo of two approaches to enforcing such 'dat-
driven' limits using table constraints:

http://groups.google.com/group/micro...4430dc8b50ba8f

Jamie.

--

  #4  
Old December 21st, 2007, 05:59 PM posted to microsoft.public.access.tablesdbdesign
Pat Hartman
external usenet poster
 
Posts: 392
Default Disable input after 5 entries

That works if the number of seats per table is a constant. Most people need
more flexibility so the rules become more complicated. But in any event, if
the OP is using Jet, table level rules are limited.

"Jamie Collins" wrote in message
...
On Dec 13, 12:56 am, mscertified wrote:
I'm working with 2 tables. One contains Table Reservations, and the
second
contains the People that will be sitting at the tables. Is there a
way to
disable assigning people to a table after 5 people have been reserved
for a
particular table?


Yes there is. If you are assigning people via a form, put a check in the
form
(query the table to see how many assigned so far).


Isn't a 'forms' approach OT for the 'tables' group g? Regardless,
don't you think that simple data rules such as these should be
enforced using table constraints? I do.

In fact, each table could have its own 'max people' and you could stop
after
the 'max people' for the table. So you could have different sized tables
taking different numbers of people.


Good point. Here's a demo of two approaches to enforcing such 'dat-
driven' limits using table constraints:

http://groups.google.com/group/micro...4430dc8b50ba8f

Jamie.

--



  #5  
Old December 21st, 2007, 06:03 PM posted to microsoft.public.access.tablesdbdesign
Pat Hartman
external usenet poster
 
Posts: 392
Default Disable input after 5 entries

To give this process more flexibility, I would assign a TableType field
which indicated the number of seats for each table. The default can be 5 if
that is the most common size. To handle this without running queries, I
would add a control in the footer of the subform that counts the number of
rows in the seating subform for the current table. In the BeforeUpdate
event of the subform, I would check the count in the subform footer and
disallow the add if the table has reached capacity.


"Harvard" wrote in message
...
I'm working with 2 tables. One contains Table Reservations, and the
second
contains the People that will be sitting at the tables. Is there a way
to
disable assigning people to a table after 5 people have been reserved for
a
particular table?



  #6  
Old December 24th, 2007, 09:33 AM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Disable input after 5 entries

On Dec 21, 5:59 pm, "Pat Hartman" please no wrote:
Good point. Here's a demo of two approaches to enforcing such 'dat-
driven' limits using table constraints:

http://groups.google.com/group/micro...4430dc8b50ba8f


That works if the number of seats per table is a constant. Most people need
more flexibility so the rules become more complicated.


Please take another look at the link I posted. In the demo the seating
capacity for each class is a column (seating_capacity) therefore is
not a constant. This is what I mean by 'data driven'.

But in any event, if
the OP is using Jet, table level rules are limited.


Do you mean a Table Validation Rule? It's a bit of a misnomer becasue
it is actually a row level rule i.e. can refer is values in the same
row in the same table but not other rows. Again, take another look at
the link I posted: the second approach uses a Jet CHECK constraint,
which are truly table level in that they can refer to values in other
rows in the same table (also rows in other tables).

Jamie.

--

 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:01 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.