Results 1 to 6 of 6
  1. #1
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142

    Simple calculation won't work

    I feel almost embarrassed to ask this, but I can't get it to work.



    I have a series of queries that are input to each other. The next to last one is a Query called ShipperAll4. Within ShipperAll4 some fields are grouped. It produces a count of one of the other fields. That field is called Official Finish Position. I use ShipperAll4 as input to a final Query. I want to use that count field as part of some calculations.

    Here's a very simple one. It just adds 1 to the value. The "CountOf" is put in front of the field by Access.

    testfield: (([CountOfOfficial Finish Position].[ShipperAll4])+1)

    Whenever I run that final Query, it prompts me to enter a value for parameter CountOfOfficial Finish Position.ShipperAll4. I guess it's not recognizing it.

    Note: there is also a field input from ShipperAll2 with the name CountOfOfficial Finish Position. That's why I am specifying where the field is coming from.

    Thanks

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I suggest you post the sql so readers can see what you have.

  3. #3
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142
    SELECT ShipperAll2.RCTrack, ShipperAll2.Track, ShipperAll2.[CountOfOfficial Finish Position], ShipperAll4.[CountOfOfficial Finish Position], ShipperAll2.SumOfWin, ShipperAll2.SumOfPlace, ShipperAll2.SumOfShow, (([CountOfOfficial Finish Position].[ShipperAll4])+1) AS testfield
    FROM ShipperAll2 INNER JOIN ShipperAll4 ON (ShipperAll2.RCTrack = ShipperAll4.RCTrack) AND (ShipperAll2.Track = ShipperAll4.Track);

  4. #4
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142
    Let me ask this question another way.

    If I have QUERY that groups some fields and does a count (which is working fine by the way), can I then use that query as input to another query and access the count field?

    That's all I am trying to do.

    If the answer is yes, that would suggest my problem is some kind of syntax error even though I can't figure out what it is.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    You could create a recordset using your query as the source, then in vba
    reference YourCountfield using something like

    Debug.Print rs!YourCountField 'to output the count to the immediate window.

    You could also do further processing/display using rs!YourCountField

  6. #6
    wcrimi is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Nov 2014
    Posts
    142
    I solved this problem. You can delete this thread. Stupid mistake. Sorry and thanks.

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

Similar Threads

  1. Replies: 1
    Last Post: 06-13-2012, 07:39 PM
  2. Replies: 1
    Last Post: 04-25-2012, 10:51 AM
  3. Simple calculation box
    By jordz in forum Reports
    Replies: 1
    Last Post: 03-19-2012, 01:40 PM
  4. Replies: 2
    Last Post: 02-22-2012, 07:14 AM
  5. Simple field calculation
    By stryder09 in forum Access
    Replies: 4
    Last Post: 02-11-2011, 11:48 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