Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

More Graphing Errors

Discussion in 'Information Technology' started by Jenn, Jul 28, 2006.

  1. Jenn

    Expand Collapse

    I am still having problems with the charting wizard. I have included the
    original question, followed by a response, and then other issues that are
    developing. You all responded so quickly and I appreciate it, but for some
    reason the suggestion is not working. I am sure I am doing something wrong.

    Here is the original problem:

    I am trying to make a report using the graph wizard. What I have is the
    following fields I want to use in the Graph:
    1) Program Name
    2) Place Found
    3) Risk Severity
    What I want the graph to do is this:
    I want “Place Found†to be on the X axis, I want “Risk Severity†to be
    counted on the Y axis. Ok so I followed the wizard and did this perfectly.
    Here is the problem. I want to be able to select a “Program Name†from a
    pulldown on a form and then have the graph report show the “Program Nameâ€
    selected as the title and then “Place Found†and “Risk Severity†data
    corresponding only o that selected “Program Name to be shown on the graph.
    I have a control on a form that allows the user to select a “program nameâ€
    from a pulldown and then it produces a query with just the info for that
    program name but I cannot 1) get the graph to produce the “Program Name†as
    either the title or text in the page header and 2) get the report to run even
    though I use that query as the data for the report.

    OK first response:

    If I understand correctly, if you just open the report by itself, it shows
    all records, but you want to limit it to just those records for a selected
    Program Name. A good way to do this is to have a CommandButton on the form
    that the user can click to open the report after selecting a Program Name
    from the ComboBox, and to only allow the user to open the report in this
    manner. In the Click event for the CommandButton, you would have something
    like this (watch for line wrap):
    DoCmd.OpenReport "ReportName",acViewPreview,,"[ProgramNameField] = " &
    Chr(34) & Forms("FormName").Controls("ComboBoxName") & Chr(34)

    In the above, be sure to replace ReportName, ProgramNameField, FormName, and
    ComboBoxName with the names of your own objects. Also, I'm assuming that
    Program Name is a string. If not, remove both instances of "& Chr(34)".

    To have the selected ProgramName appear in the title of the report, insert a
    TextBox in the Report Header, and set its Control Source to:
    ="Selected Program Name: " & [Forms]("FormName").[Controls]("ComboBoxName")

    You will probably want to add additional code that enables/disables the
    form's CommandButton depending on whether a Program Name has been selected,
    as you may get errors or a blank report if the user attempts to open the
    report with no Program Name selected.

    Jenn’s RESULT and current issue:

    So I tried the above mentioned suggestion and I am sure it works but for
    some reason, the graph using shows all the fields not just the ones selected
    from the combo box.

    If I go back to the first way of doing this (using a combo box to select a
    criteria for a query, using a command button to run the query and then
    generate the report based on the query) the following thing happens:

    If I have the graph reference the query that uses the combobox to limit its
    selections, the graph only displays data if I select 1 item for the graph
    (for instance just “place found†on the X axis) . If I try to have multiple
    data selections for the graph (one on the X axis and one on the Y axis- for
    instance “place found†on the X axis and “severity†on the Y) the graph does
    not generate any data.

    TIA for the help.
  2. Loading...

Since you're here... we have a small favor to ask...     Become a Supporter      ::     Make a Contribution     

Share This Page