Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    graph 8 in access 2k report (2000)

    I have a graph 97 in a report in Access 2k. Its rowsource is an SQL statement defined in the rowsource property of the graph. This graph only displays properly if the linked fields have a "show" value of true within the query. If they are used in the query as criteria but are not shown, access asks for parameters when opening the graph on the report. If no parameters are given, the graph is blank. WHY IS THIS SO?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: graph 8 in access 2k report (2000)

    A select query results in a recordset consisting of rows (records) and columns (fields). By definition, only those fields that have "Show" ticked, will be columns in this recordset. Fields that are only used to set criteria limit the rows of the recordset, but do not become columns in the recordset.

    If you look at the SQL statement, it may become clearer. Here is a general example: you have a table tblPersons with three fields: LastName, FirstName and City. You want to return the names of all persons living in Chicago. You create a query based on tblPersons, drag LastName, FirstName and City to the grid, uncheck the "Show" box for City and enter "Chicago" in the first criteria line under City. The SQL statement for this query is:

    SELECT LastName, FirstName FROM tblPersons WHERE City = "Chicago"

    As you can see, only LastName and FirstName are SELECTed. City is only used in the WHERE part, but not SELECTed. It may be a column in the query design, but not in the result of the query. If you open the query in datasheet view, you only see LastName and FirstName.

    Now, the chart on your report uses the recordset; it only "sees" the columns of the recordset. Fields used only for criteria have played a role in limiting the number of rows, but don't feature in the recordset. So they can't be used as link fields.

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: graph 8 in access 2k report (2000)

    Boy, I feel foolish. Thanks for setting me straight. Just one question, though. How did this work in 97?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: graph 8 in access 2k report (2000)

    I use Access 97 myself; I don't think this is different.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •