Results 1 to 3 of 3
  1. #1
    AlexBen is offline Novice
    Windows 10 Office 365
    Join Date
    Sep 2021
    Posts
    10

    Graph


    Good day! I have a graph that should show only the current record. I used [Forms]![FormName]![FieldName] for the criteria. Every time I would open the form, it would ask me that. The SQL in the ROW SOURCE for the graph is SELECT GraphRaw.BoarID, GraphRaw.CountOfCollection_Date, GraphRaw.SumOfTubes, GraphRaw.BiWeekly, GraphRaw.Year, Round([SumOfTubes]/[CountOfCollection_Date],2) AS Ave FROM GraphRaw WHERE (((GraphRaw.BoarID)=[Forms]![Main]![Boar_ID]));

    Thanks in advance!

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Is the sql actually in the rowsource or in a query and the rowsource is the query name?

    and what is the form you are referring to? Main?

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Is Main form already open when form with graph opens?

    Is this graph located in a form used as subform on Main?

    I presume BoarID is in the graph form's RecordSource so I would name a textbox holding that value to tbxBID then change WHERE clause to: BoarID=tbxBID. Has worked for me but I use classic MS Graph, not Modern Chart. SQL statement in RowSource can be simplified:

    SELECT BoarID, CountOfCollection_Date, SumOfTubes, BiWeekly, [Year], Round([SumOfTubes]/[CountOfCollection_Date],2) AS Ave FROM GraphRaw WHERE BoarID=[tbxBoar_ID];

    If you want to provide db for analysis, follow instructions at bottom of my post. Unfortunately, if you are using Modern Chart I won't be able to view it.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 24
    Last Post: 07-28-2015, 10:50 AM
  2. Bar Graph
    By scoobz1234 in forum Access
    Replies: 10
    Last Post: 04-03-2012, 12:28 PM
  3. Replies: 6
    Last Post: 02-29-2012, 03:13 AM
  4. Graph
    By Ray67 in forum Reports
    Replies: 8
    Last Post: 10-15-2011, 10:38 AM
  5. Replies: 3
    Last Post: 01-10-2011, 10:31 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