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

    Is it possible to have a message box appear for a result for a query?


    My report that is made shows how many days the person has been in the campground in the past 30 days. I would like for the message box to tell the user if they can stay anymore days and how many. Our rule for this database is that the camper cannot stay more than 14 days in a 30 day period. The report only shows how many days they have stayed in the 30 day period not the total amount of days they can stay on that date.

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Wouldn't it be simple math? 14 minus how many days they have stayed?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    Have you tried 14 - Dcount(DaysStayed)? in a box in the footer?
    Last edited by Perceptus; 04-29-2016 at 10:06 AM. Reason: topic title doesnt match answer

  4. #4
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    I tried but it will not work

  5. #5
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    What area would you consider to be the place that I would do the simple math. I tried subtracting 14 in the sql view but returned a negative number

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I wouldn't subtract 14, I'd subtract the number from 14.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    This is what I have.

    SELECT qryLicenseSearch.CamperLicenseNumber, Sum(qryLicenseSearch.[TotalDays 1]) AS [SumOfTotalDays 1], Sum(qryLicenseSearch.test2) AS SumOftest2, Sum(qryLicenseSearch.test3) AS SumOftest3, Sum(qryLicenseSearch.test4) AS SumOftest4, Sum(qryLicenseSearch.test5) AS SumOftest5, Sum(qryLicenseSearch.test6) AS SumOftest6, Sum(qryLicenseSearch.test7) AS SumOftest7, Sum(qryLicenseSearch.test8) AS SumOftest8, Sum(qryLicenseSearch.test9) AS SumOftest9, Sum(qryLicenseSearch.test10) AS SumOftest10, Sum(qryLicenseSearch.test11) AS SumOftest11, Sum(qryLicenseSearch.test12) AS SumOftest12, Sum(qryLicenseSearch.test13) AS SumOftest13, Sum(qryLicenseSearch.test14) AS SumOftest14, Sum(qryLicenseSearch.test15) AS SumOftest15, Sum(qryLicenseSearch.test16) AS SumOftest16, Sum(qryLicenseSearch.test17) AS SumOftest17, Sum(qryLicenseSearch.test18) AS SumOftest18, Sum(qryLicenseSearch.test19) AS SumOftest19, Sum(qryLicenseSearch.test20) AS SumOftest20, Sum(qryLicenseSearch.test21) AS SumOftest21, Sum(qryLicenseSearch.test22) AS SumOftest22, Sum(qryLicenseSearch.test23) AS SumOftest23, Sum(qryLicenseSearch.test24) AS SumOftest24, Sum(qryLicenseSearch.test25) AS SumOftest25, Sum(qryLicenseSearch.test26) AS SumOftest26, Sum(qryLicenseSearch.test27) AS SumOftest27, Sum(qryLicenseSearch.test28) AS SumOftest28, Sum(qryLicenseSearch.test29) AS SumOftest29, Sum(qryLicenseSearch.test30) AS SumOftest30
    FROM qryLicenseSearch
    GROUP BY qryLicenseSearch.CamperLicenseNumber;

  8. #8
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    please look at my next post and let me know where to put it in

  9. #9
    TLCTech is offline Novice
    Windows 10 Access 2013
    Join Date
    Dec 2015
    Posts
    26
    Here is where I subtracted 14 and it gives a negative number.

    SELECT qryLicenseSearch.CamperLicenseNumber, Sum(qryLicenseSearch.[TotalDays 1])-14 AS [SumOfTotalDays 1], Sum(qryLicenseSearch.test2)-14 AS SumOftest2,

  10. #10
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    14 - Sum(qryLicenseSearch.[TotalDays 1]) AS [SumOfTotalDays 1]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query Result Help
    By chaddresnick in forum Access
    Replies: 1
    Last Post: 06-30-2015, 02:34 PM
  2. Error Message Result In Count Formula
    By EHittner in forum Forms
    Replies: 4
    Last Post: 10-22-2013, 10:52 AM
  3. Could not see a query result
    By alobi in forum Access
    Replies: 2
    Last Post: 02-04-2013, 02:42 AM
  4. Replies: 8
    Last Post: 05-16-2012, 09:30 AM
  5. VB ADO Query Result Set
    By Bedsingar in forum Access
    Replies: 5
    Last Post: 09-05-2011, 10:45 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