Get a Jumpstart with our Sample Apps
Results 1 to 6 of 6

Thread: How do I limit the number of entries in a table?

  1. #1
    Member
    Real Name
    Don O'Malley
    Join Date
    Dec 2004
    Posts
    82

    Default How do I limit the number of entries in a table?

    I have a table with the usual suspects of name, address, CSZ and a field of individual number. This field is autoincrement starting at 001. I would like to limit the number of new names in this table to 10. How do I get it to not add and put up a message that they are in excess of 10.

    Quack

  2. #2
    "Certified" Alphaholic Keith Hubert's Avatar
    Real Name
    Keith Hubert
    Join Date
    Jul 2000
    Location
    London, UK
    Posts
    6,930

    Default Re: How do I limit the number of entries in a table?

    I think you must be Quackers. Why do you want to limit the number of customers to 10?
    Regards
    Keith Hubert
    Alpha Guild Member
    London.
    KHDB Management Systems
    Skype = keith.hubert


    For your day-to-day Needs, you Need an Alpha Database!

  3. #3
    Member
    Real Name
    Don O'Malley
    Join Date
    Dec 2004
    Posts
    82

    Default Re: How do I limit the number of entries in a table?

    There not customers they are individual entries representing a member of an organization. Say my customer has an office and thye have at this time 9 employees and they are recording work that each has done. Each job is a tagged to an employee. They paid me for a 10 user program. If they hire 2 new employees they would have to upgrade the software to greater number of employees. I'm looking into selling software but I want to limit the entries (employees) not the jobs. So there would be a parent-child relationship.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    24,697

    Default Re: How do I limit the number of entries in a table?

    You could use this as the cansaverecord event code in the table field rules.

    Code:
    tbl = table.current()
    if tbl.recno() > 10
    	cancel()
    	ui_msg_box("Sorry","Only ten users allowed.")
    end if
    If they want to delete a user id and add another the table would have to be packed after the deletion.

    It could also be done this way, same event, but the packing would not be necessary.

    Code:
    if reccount("yourtablename") > 9
    	cancel()
    	ui_msg_box("Sorry","Only ten users allowed.")
    end if
    Last edited by Stan Mathews; 07-20-2011 at 06:34 PM.

  5. #5
    Member
    Real Name
    Don O'Malley
    Join Date
    Dec 2004
    Posts
    82

    Default Re: How do I limit the number of entries in a table?

    Thanks Stan

  6. #6
    Member
    Real Name
    Don O'Malley
    Join Date
    Dec 2004
    Posts
    82

    Default Re: How do I limit the number of entries in a table?

    Stan: I plugged in the code you sent and I did receive the error message when I hit number 11, but I was still able to put in the info and again for 12, 13, etc.

    ??

    Donald

Similar Threads

  1. Number entries being rounded?
    By Leonw43 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 9
    Last Post: 03-09-2010, 10:02 AM
  2. Limit to number of Fields in a table?
    By walhoney in forum Alpha Five Version 5
    Replies: 7
    Last Post: 07-14-2005, 08:56 AM
  3. Is there a limit to the number of reports?
    By Hilllo in forum Alpha Five Version 6
    Replies: 4
    Last Post: 01-05-2005, 01:39 PM
  4. variable for unkown number of entries
    By Anis in forum Alpha Five Version 6
    Replies: 8
    Last Post: 12-17-2004, 09:32 AM
  5. Correct total on the number of entries
    By helen forge in forum Alpha Five Version 5
    Replies: 1
    Last Post: 10-09-2002, 01:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •