Forms and Reports

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • DCD

    Forms and Reports

    I was wondering if anyone knew how to create a report from information that
    you select on a form. I have a few of the fields on the form linked to a
    table, however some of the other ones are not linked, and are totally
    separate.

    Thanks.
    DC


  • Mike Preston

    #2
    Re: Forms and Reports

    On Mon, 19 Apr 2004 19:41:40 -0400, "DCD" <price_damon@ya hoo.com>
    wrote:
    [color=blue]
    >I was wondering if anyone knew how to create a report from information that
    >you select on a form. I have a few of the fields on the form linked to a
    >table, however some of the other ones are not linked, and are totally
    >separate.[/color]

    The information on the form is referenced as a "control", not as a
    "field". "Field"'s are found in tables.

    If you put a command button on the form which opens a report linked to
    the same table that is linked to the form, then you can be assured
    that the form is open while the report is being run and that the
    information from the same table is avaialable to the report.

    With that assured, you can place unbound text boxes on the report and
    populate them with the information from the (guaranteed to be open)
    form.

    You can populate those unbound text boxes in two ways:

    1) Put the information into the text boxes via vba in the report's
    module

    2) Put a form's unbound text box reference into the report's unbound
    text box as its source.

    Post back if you have trouble accomplishing one or the other.

    mike

    Comment

    • Don Leverton

      #3
      Re: Forms and Reports

      Hi DC,

      Have a look at one of my recent replies to a similar request.


      The basic idea involves gathering parameters from your form, then building
      an SQL string (Query) in code that is used as the Recordsource of a
      datasheet-style subform. The subform automatically refreshes and displays
      the results of the parameters selected.

      The SAME SQL is then used as the recordsource for the report, so you know
      exactly what to expect before you even open the report.

      There really are nearly no limits as to how flexible and creative you can
      get using this method. I have written code that handles ANDs and ORs and
      ORDER BYs, and even formatting for different DataTypes. If you're
      interested in something in particular, post some sample SQL from one of your
      existing queries, along with what you'd like for options.


      --
      HTH,
      Don
      =============== ==============
      Use My.Name@Telus.N et for e-mail
      Disclaimer:
      Professional PartsPerson
      Amateur Database Programmer {:o)

      I'm an Access97 user, so all posted code
      samples are also Access97- based
      unless otherwise noted.

      Do Until SinksIn = True
      File/Save, <slam fingers in desk drawer>
      Loop

      =============== =============== ==


      "DCD" <price_damon@ya hoo.com> wrote in message
      news:10899bhncj bi96d@corp.supe rnews.com...[color=blue]
      > I was wondering if anyone knew how to create a report from information[/color]
      that[color=blue]
      > you select on a form. I have a few of the fields on the form linked to a
      > table, however some of the other ones are not linked, and are totally
      > separate.
      >
      > Thanks.
      > DC
      >
      >[/color]


      Comment

      Working...