Results 1 to 3 of 3
  1. #1
    ExcessionOCP is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    31

    Pull a value from a separate query into a report, using a field in the report as a parameter


    Apologies for the long-winded question.



    I am capturing how much our company spends within specific cost categories (Capital expenditure, materials, resource etc.) and then reporting on it. I have a report that shows a summary of the spend in each category, grouped by the category, with the total for each category shown in a footer. My report is reading values from a form that allows the user to specify a particular project and work package within that project to report on.

    Each category has a budget, and that budget differs between projects, and between different work packages within a project. I have a separate table that records each budget for each category in each work package and project.

    I would like to show the budget for each category as a field in my report, so that I can then create a calculated field which displays the amount left to spend, using the summary shown in my report.

    So, for each grouped category in the report, I would like to have a field that queries my budget table and returns the relevant budget for that category, using the category field in my report as a parameter in my query - is it possible to reference a report field in a query in the same way that you can reference a field in a form? (using the [Forms]![...] syntax)?

    Hopefully someone can a) understand my question and b) offer some advice

    Thanks very much in advance

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,913
    Best to join in the recordsource if you can.
    Else use DLookUp().
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,537
    Can you post a copy of your db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

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

Similar Threads

  1. Replies: 8
    Last Post: 01-21-2022, 03:57 PM
  2. Replies: 6
    Last Post: 05-18-2018, 12:46 PM
  3. Replies: 11
    Last Post: 02-23-2017, 04:26 PM
  4. Replies: 1
    Last Post: 10-08-2015, 10:59 AM
  5. Replies: 2
    Last Post: 03-07-2013, 04:50 PM

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