Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601

    Unanswered: Cutting off slots

    Hello all

    I know that isn't the best title but that's all I can come up with...

    What I am doing is setting up a db for a training. I am have a few questions. There are four sessions total, but each can only have 30 peple.

    1. So is there a way that when a session hits 30 it cuts off, and people can no longer sign up for that session? A "this session is full, try another" message would be nice.

    2. How can I make the people be auto numbered on a report? So when the report is ran we can see how many people will be at a session. I have done this before, but forget.

    3. When a form is opens, I need it to be blank and only able to submit that record, and not able to see anybody elses...to protect privacy.

    Thanks
    (PS - Hey Ted)
    Ryan
    My Blog

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    1) At the appropriate place in your process, open a recordset or use DCount to count how many people are in the session, react accordingly.

    2) Put in a textbox with a control source of =1 and set the running sum property.

    3) Set the data entry property to yes
    Paul

  3. #3
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    poss alternative to recordset:

    private sub form_load()
    strSQL = "SELECT SessionDateTime, Count(PersonID) AS numBookings FROM tblBookings GROUP BY SessionDateTime"
    me.mylistbox.rowsource = strSQL

    that puts the sessions and current booking counts into a list mylistbox
    then when the user tries to select a session

    private sub mylistbox_afterupdate()
    if me.mylistbox.column(1) > 29 then
    msgbox "sorry but the " & me.mylistbox.column(0) & " session is full"
    me.mylistbox = null
    exit sub
    else
    ........the user chose the available session me.mylistbox.column(0)
    ........do whatever is appropriate

    izy
    currently using SS 2008R2

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Your biggest difficulty with the session counting thing is making sure users unregister as they finish. Obviously you can have some hidden\ switchboard form OnClose event handle it but, in the event of a crash for example, this is rarely robust enough.

    I think I would have my FE apps confirm their session status regularly (say every five minutes) using a form OnTimer event. Any that have not confirmed for perhaps ten mins are considered to have ended the session.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    thanks guys. I am still working on getting Izy's to work and what it would do exactly.
    Ryan
    My Blog

Posting Permissions

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