Results 1 to 6 of 6
  1. #1
    XPeriment is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    3

    Validating the table

    Hey guys,

    I have a table of a certain treatment room filling up with patients. The room has a certain capacity which can't be exceeded.


    Now I've created a table which will contain the patients ID's and whether they are sitting or lying down (=like 3 sitting patients). I have a field called weight according to sitting/lying - either 1 or 2.
    I have a form that the scheduler will assign ID's and the type of patient (sitting/lying) and I want that he won't be able to exceed the capacity - so when the sum of the weights of the records in the table - it wouldn't let the form to add another patient ?
    Any ideas?
    I thought about autonumber and doing field validation - but it doesn't always resets, and harder with the weights.

    What do you think?
    thanks
    Amir

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    I think you are mixing analysis with design. Get a clear statement of WHAT you are trying to do-in simple English (or native language). Get your tables and relationships identified based on your business rules/facts. Test the model with test data and scenarios (pencil and paper). Adjust the model/data/facts as necessary until scenarios reflect your rules.

    Then work out the interface (forms and reports) for implementation in Access.

    Major entities:

    Patients
    treatment room(s)
    PatientPosition
    RoomCapacity

  3. #3
    XPeriment is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    3
    Quote Originally Posted by orange View Post
    I think you are mixing analysis with design. Get a clear statement of WHAT you are trying to do-in simple English (or native language). Get your tables and relationships identified based on your business rules/facts. Test the model with test data and scenarios (pencil and paper). Adjust the model/data/facts as necessary until scenarios reflect your rules.

    Then work out the interface (forms and reports) for implementation in Access.

    Major entities:

    Patients
    treatment room(s)
    PatientPosition
    RoomCapacity
    thanks!
    I don't think I'm mixing.
    Will try again in simple English:
    The user will use a form that will assign patients (rows in the table) into the room (each patient takes different size of the room).
    When he will try to assign a new patient that will exceed the capacity I want the form to alert it can't add any more

    Amir

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Please show us your tables and relationships. Forms don't store data --tables store data.
    How many Rooms are involved? What is capacity of each? How do you monitor sitting/lying?
    How do you determine which room a patient goes to/is assigned to?

    each patient takes different size of the room
    Number of people per room or something else? cubic feet?

    What is the weighting factor for?

    Assuming a long line of Patients.

    -get the next Patient
    -check Rooms for available capacity (review assignment/discharge transactions to get current available capacity)
    ---assign Patient to Room with Capacity (determine assignment of sitting/lying somehow)
    --if not capacity available --Alert supervisor/monitor.

    Good luck with your project.

  5. #5
    XPeriment is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Aug 2016
    Posts
    3
    Oh jesus, now you've complicated it more than simple English

    The table has: ID (the user input), Lying (1/0) - user will tick, Sitting (1/0)- user will tick, and a calculated weight =2*sitting + 1*sitting + 1
    the capacity is a known number to me. not in the table or the form. let's say it's 12 (which can be a different combination).
    when the sum of the previous weights gets to 12 - the user won't be able to enter a new ID.

    I just don't know how to do a limitation of sum of this weight field

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    ??
    Get a clear description of the problem/opportunity you are trying to solve.
    Do some research (Google) on database and normalization.

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

Similar Threads

  1. Validating text boxes
    By bigguy in forum Forms
    Replies: 1
    Last Post: 03-31-2015, 10:53 PM
  2. Validating data against two tables
    By MTSPEER in forum Programming
    Replies: 3
    Last Post: 03-30-2015, 10:48 AM
  3. Validating Email Address in VBA
    By Phil1 in forum Programming
    Replies: 4
    Last Post: 04-19-2012, 09:54 AM
  4. validating fields
    By bhatia.puja in forum Access
    Replies: 3
    Last Post: 07-28-2011, 05:24 AM
  5. Validating tables
    By JVagenheart in forum Database Design
    Replies: 1
    Last Post: 06-10-2006, 09:03 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