Form information not showing in Report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robtech4
    New Member
    • Jul 2012
    • 33

    Form information not showing in Report

    Hello All,

    I have a form that is half autofilled and half filled out by manually typing information in. I have a print button that generates the form into a report and gives the option to print. The manually information is not showing in the report view and is not printing. The manually boxes are typed into an "Unbound" box.

    --hopefully I will not have to create a complicated table that will draw info from another table as well as hold new information thats entered in the form.

    **Need information to print, do not need manually typed info saved in access.

    Thanks in advance!
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3653

    #2
    Rob,

    Is this "report" just printing the form, or is it an actual report created in Access? If it is a Report, then it will need a record source, whether that is a table or a query or something else. It might be possible to create a query based on all the unbound controls on the form, but it may be simpler to create a table underneath that form.

    I don't think your solution will be too very complicated, as manually entered data on a form CAN be used in queries and then on reports. I would just hav eto see how the data is being kept on the form....

    Comment

    • robtech4
      New Member
      • Jul 2012
      • 33

      #3
      Twinnyfo,

      The printing button is linked to a report. When the print button is pressed a report opens up in access and the information that was in the form is supposed to be what's printing. Everything except for the manually entered data is printing (showing in the report).

      The record source of the form is linked to a query which is populating the automated fields out of my "tblMaster" (as we discussed in the past).
      Attached Files

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3653

        #4
        The manually entered data is always going to be temporary, because it is not "saved" anywhere in the database. What is the recordsource for the report? The same query used for the form? You will need to marry up the query underlying the form with the data entered on the form.

        Again, this is typically not the best practice when building tables, forms and reports.

        Comment

        • robtech4
          New Member
          • Jul 2012
          • 33

          #5
          The record source in the report is the tblMaster and the record source in the form is a query that just references the tblMaster. I honestly don't know why I have it set up like this but looking at it and telling you this makes me feel like an idiot because there is no way that can be right. Can you please advise on what it should be...


          With Appreciation,

          Rob

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3653

            #6
            Rob,

            Based on your description, your report should be based a query built on the table AND the form. When you are building your query, you will be able to declare one (or more) of your output fields as controls on the form. Use this Syntax below for your output field:

            Code:
            OutputName: Forms![frmFormName]![txtControlName]
            This will give you an output field in your query called "OutputFiel d", but its value will be based on the control "txtControlName " on your form called "frmFormNam e"

            Hope this helps.

            Comment

            • robtech4
              New Member
              • Jul 2012
              • 33

              #7
              Twinny,

              Could you provide a bit more detail? I have the query somewhat set up but I am not sure exactly what the SQL should look like and the correct way to incorporate the code you sent.

              Where is the output field in the query?

              Thank you for your patience and help!

              Comment

              • twinnyfo
                Recognized Expert Moderator Specialist
                • Nov 2011
                • 3653

                #8
                Rob,

                Please take a look at the attached DB. I created a very simple table with a few fields and a few records. A form based on that table, with a couple unbound text boxes. A query based on the record currently being shown in the form, with the unbound fields included. A report with the same fields as found on the form. Just remember to set the unbound text boxes to the field names in the query. Clicking the print button will bring up the report.

                Does this get you pointed in the right direction?
                Attached Files

                Comment

                • robtech4
                  New Member
                  • Jul 2012
                  • 33

                  #9
                  GOT IT! The code worked like a charm.

                  THANK YOU!!

                  Comment

                  Working...