Results 1 to 10 of 10
  1. #1
    Seattle5674 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11

    Access Query- perameter box wont go away & Report grouping and subtotals

    Hello,



    I am looking to fix a few quiries because they have the peramter box showing up whent they should not. How do I fix the peramter box from not showing up? example below

    Click image for larger version. 

Name:	Query 2.png 
Views:	17 
Size:	24.7 KB 
ID:	47178
    Click image for larger version. 

Name:	Parameter issue on Query 2.png 
Views:	16 
Size:	6.7 KB 
ID:	47179

    I am also trying to fix this report with grouping and subtotals. It current look like this below:

    Click image for larger version. 

Name:	Report 1.png 
Views:	15 
Size:	20.6 KB 
ID:	47180

    and I want it to look like this below:

    Click image for larger version. 

Name:	What report should look like.png 
Views:	15 
Size:	85.4 KB 
ID:	47181

    any advise helps, thank you

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    The parameter prompt is Access telling you it can't find whatever is specified. In your case, I don't see Date Spent in either table, hence the prompt. Where is it you expect Access to get this value?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Oh, and you didn't show how the report design looks now. Looks like you need to group by customer and put the customer details in the group header, the vehicle details in the detail section.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    Seattle5674 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Hi pbaldy,

    Here is the good news, I was able to get rid of the peramater box, however it is only when I have to show a field.

    in the example below, I want the Date field to be gone when I run the query.

    Click image for larger version. 

Name:	Quer 2 part 2 results.png 
Views:	14 
Size:	24.1 KB 
ID:	47182


    Click image for larger version. 

Name:	Quer 2 part 2.png 
Views:	15 
Size:	29.5 KB 
ID:	47183

    I had to add in the rental start and end dates to get the number of days between them- as a calculated field. I then had to take that date results number and * it by the price per day to get total spend. If I uncheck the SHOW box for Date: it brings up that permater box when I run it. That is what I want to get rid of.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Just do the math in Total Spent. Put your actual field names in:

    Total Spent: Price * (End - Start)

    You shouldn't need any of the other fields if you don't want them, even if they're used in the calculation.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    By the way, spaces and symbols in your object names are not worth the trouble in the long run. Some use underscores, I like camel case: PricePerDay.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    Seattle5674 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    I tried that and this is the result I got. are the brackets right? How do I avoid #NUM

    Code:
    Total Spent: [Price Per Day]*[Rental End Date]-[Rental Start Date]
    Click image for larger version. 

Name:	Q1.png 
Views:	12 
Size:	21.2 KB 
ID:	47186

    Click image for larger version. 

Name:	Q11.png 
Views:	12 
Size:	25.4 KB 
ID:	47187

  8. #8
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you need to take account of calculation priorities - multiplication/division is calculated before addition/subtraction - see Pauls post#5 re placing of brackets

    in case you are not aware, dates are stored as decimal type numbers. Today is 44590 and now (including time) is 44590.4668171296 where the value after the dp is the number of seconds so far today divided by 86400 (number of seconds in a day). How you see it as a date is just formatting which will be ignored when calculating

    So if your date fields contain a time element hidden by formatting, your calculation will be wrong

    I would also add that if a customer rents for less than a day - picks up in the morning, returns in the afternoon, your rental period will be 0.

  9. #9
    Seattle5674 is offline Novice
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    11
    Thank you, I was able to add the right brackets () on my calc field and it worked.

  10. #10
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Quote Originally Posted by Seattle5674 View Post
    Thank you, I was able to add the right brackets () on my calc field and it worked.
    If you haven't heard of BEDMAS for calculations, you might want to check it out.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Code check please -query asking for perameter
    By Jen0dorf in forum Access
    Replies: 3
    Last Post: 08-25-2016, 03:13 PM
  2. Replies: 3
    Last Post: 02-08-2016, 02:22 PM
  3. Replies: 7
    Last Post: 08-02-2012, 07:31 AM
  4. Hiding Subtotals in Access 2007 Report
    By kristyspdx in forum Reports
    Replies: 8
    Last Post: 11-30-2011, 11:46 AM
  5. Subreport grouping subtotals
    By herolind in forum Reports
    Replies: 1
    Last Post: 06-18-2011, 10:23 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