Results 1 to 6 of 6
  1. #1
    Shag84 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    18

    Limited student roster

    Hello,



    I was hoping you could point me in the right direction, please. I'm trying to do a database for our cardiac rehab members. My question concerns a limited roster.
    We have 6 class times with a max of 10 patients per class. Could you recommend a way to prevent filling more than the 60 available slots?

    Are there any scheduling dbs out there too refer to? I've been searching Google but have been coming up empty.

    Thanks for your help.
    Don

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    when you open the form ,frmClass detail, it would have a subform frmRoster.
    put an ADD button on the form
    in the bottom footer of frmRoster, put a textbox, txtCount where source: =Count(ClientID)
    it would not allow additions unless the subform count < 10.

    Code:
    sub form_OnCurrent()
      btnAdd.enabled= me.frmRoster!form!txtCount < 10
    end sub
    clicking the button opens an entry form ,frmStudent, to fill out all student info,
    or
    the form lets user pick an existing person, and then click SAVE button to add them, then update the subform button to turn off additional entries if you hit the limit.

  3. #3
    Shag84 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    18
    Thank you ranman256!! I very much appreciate your help. I will get on this right away. Thanks again.

  4. #4
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    Quote Originally Posted by Shag84 View Post
    Hello,

    I was hoping you could point me in the right direction, please. I'm trying to do a database for our cardiac rehab members. My question concerns a limited roster.
    We have 6 class times with a max of 10 patients per class. Could you recommend a way to prevent filling more than the 60 available slots?

    Are there any scheduling dbs out there too refer to? I've been searching Google but have been coming up empty.

    Thanks for your help.
    Don
    I find the best to set the form's AllowAdditons property. This will work with any UI design.


    Code:
    Private Sub Form_Current()
        
        ' if 10 is the max records to enter
        Me.AllowAdditions = Me.RecordsetClone.RecordCount < 10
    
    End Sub
    or the long version
    Code:
    Private Sub Form_Current()
        
        ' if 10 is the max records to enter
        If Me.RecordsetClone.RecordCount < 10  Then 
           Me.AllowAdditions = True
        Else
           Me.AllowAdditions = False
        End If
    End Sub

  5. #5
    Shag84 is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2009
    Posts
    18
    Thank you, HiTechCoach. I appreciate the help.
    Don

  6. #6
    HiTechCoach's Avatar
    HiTechCoach is offline MS MVP - Access Expert
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2010
    Location
    Oklahoma, USA
    Posts
    702
    You're welcome. Glad we could assist.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. syntax for annual leave roster
    By gint32 in forum Programming
    Replies: 25
    Last Post: 03-08-2015, 04:07 PM
  2. Replies: 1
    Last Post: 01-24-2015, 12:09 PM
  3. Replies: 2
    Last Post: 07-21-2014, 08:47 AM
  4. Personnel Roster with 4 sections
    By tat2z_21 in forum Access
    Replies: 8
    Last Post: 01-20-2011, 04:56 AM
  5. Link Meeting with Roster?
    By Guinea in forum Access
    Replies: 58
    Last Post: 09-03-2010, 12:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums