Results 1 to 12 of 12
  1. #1
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26

    How to Sum the DaysStayed column and subtract from 14 then give a message

    After the sum has been calculated and subtracted from 14, I need to have a message box come up for the user to instruct them if the person on the record is <=14 or >= 14. If less than 14 display how many days they have left. If no days left have a message what date they can come back which is already a column in my tblRegistration called "NextAvailableDate




    Registration.zip"

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    in your form (or report) show sum,
    another box for DaysRem,
    another box for NextAvailDate. (invisible)

    if daysRem = 0 then then
    NextAvailDAte.visible = true
    endif

  3. #3
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    How do you get the sum of the days of the records of the same person. As you see in my tblRegistration, I have a last name of Casey that has a total of 14 days in the 30 day period. How do I add his days in the DaysStayed column and subract from 14 to give me a number of remaining days?

  4. #4
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    How do you get the sum of the days of the records of the same person. As you see in my tblRegistration, I have a last name of Casey that has a total of 14 days in the 30 day period. How do I add his days in the DaysStayed column and subract from 14 to give me a number of remaining days?

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    the form is connected to the query,
    text box txtTotal = [sum]-14

  6. #6
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26

    How to Add NextAvailableDate column

    I need to add the column NextAvailable Date to my query when the total days are >=14. Is there a simple way to add this? Every time I add the table column it gives me an error that it is not in the expression. Aslo when I add the column, I lose the SumOfDaysStayed. It goes back to the entry of each record instead of giving me the total days.

    Here is a copy of my table, query, and form that I am using.
    Data.zip

  7. #7
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    You have excel files in that zip, not access files.

    Access is a relational database, excel isn't.

  8. #8
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26

    New Attached Files

    Quote Originally Posted by rpeare View Post
    You have excel files in that zip, not access files.

    Access is a relational database, excel isn't.


    Sorry for that. I thought we were suppose to send the exported excel files.
    Here is the actual Database

    Camper Registration.zip

  9. #9
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    ug, are you using multi value fields or calculated fields in the table tblRegistration?

  10. #10
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    Multi value fields

    Quote Originally Posted by rpeare View Post
    ug, are you using multi value fields or calculated fields in the table tblRegistration?

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    don't use multi value fields, they a titanic pain the ass to deal with. I do not have a computer that can look at multi value fields/calculated fields right now so I'll try on monday or tuesday if someone hasn't gotten to it by then

  12. #12
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    If your example database does not rely on the multi value field can you take out that field and repost your example database. If it does rely on the multi value field then this will be an incredibly painful process for you and I do not think it can be done with queries alone you would have to get vba involved.

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

Similar Threads

  1. Replies: 2
    Last Post: 12-15-2015, 03:25 AM
  2. Subtract from Previous Row
    By lambo102 in forum Queries
    Replies: 1
    Last Post: 08-06-2011, 09:39 AM
  3. How to do subtract in Query
    By NoOoN in forum Queries
    Replies: 6
    Last Post: 04-07-2011, 01:15 PM
  4. Subtract from inventory
    By NISMOJim in forum Access
    Replies: 5
    Last Post: 01-30-2011, 01:09 PM
  5. (simple) Expressions give error message
    By P.Hofman in forum Forms
    Replies: 3
    Last Post: 01-21-2010, 01:57 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