Results 1 to 4 of 4
  1. #1
    hokiebill is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    2

    Question If Control Source is "=[revenue2015]" i get a different answer than if it iss "Revenue2015"

    Please bear with me and I apologize if this question has been answered already. If it has, please point me to the previous solution. It's not that I can't search, it's just that I am very novice and learning and I am not sure what words to search for with this particular problem.

    I have a report that I am updating for 2016. I had to go into a couple queries to update the design to grab data from a new table. That all went perfectly with no problem. At least I think it did.

    The problem occured when I updated my report's text box control sources in the report. Here is the example of my problem.

    I had a query field updated from Revenue2015 to Revenue2016.
    I had a query field updated from Revenue2014 to Revenue2015.

    I made the appropriate changes, ran the report, but the numbers were coming out wrong (Keep in mind, I did check the results of the query and saved it). I tracked down the problem to the field not updating from the 2014 data. In other words, the textbox shows "=[revenue2015]-[cost2015]" (note the formula, which necessitates the need for the brackets) but uses the revenue from 2014 (the cost2015 field is acting fine). If I go in and change it to the true control source to just show "Revenue2015" it is fine.

    To simplify, if I eliminate as many variables as possible, here is what I'm seeing.



    Control Source Result when Report is run
    =[Revenue2015] $140,000 $140,000 is the revenue i had in 2014, not 2015
    Revenue2015 $150,000 This is the correct 2015 revenue

    The query I'm running used to use the data from 2014, but no longer does. If I run the query, all the numbers show up correct. So there is no reaosn why I should ever be seeing any results of $140,000. How do I correct this?

  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,652
    First thing I would check for is a textbox with the name "Revenue2015". I suspect when you use the "=", you get the value from that textbox, not the field you expect.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    hokiebill is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    2
    @pbaldy Holy crap, that was it. Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help, and welcome to the site!

    By the way, normally you wouldn't create a year-specific report. I'd have the user enter criteria (date range, year, whatever). Via a parameter query or other method I'd restrict a report to that date range, year, whatever.
    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. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  2. Replies: 5
    Last Post: 06-24-2015, 11:46 AM
  3. Replies: 5
    Last Post: 06-25-2012, 02:06 PM
  4. Replies: 13
    Last Post: 01-11-2012, 09:44 PM
  5. Replies: 3
    Last Post: 03-21-2011, 05:29 PM

Tags for this Thread

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