1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Access2007: report does not display all fields

Discussion in 'Business Applications' started by NewbieButTrying, Nov 16, 2011.

Thread Status:
Not open for further replies.
Advertisement
  1. NewbieButTrying

    NewbieButTrying Thread Starter

    Joined:
    Nov 16, 2011
    Messages:
    5
    Because form printing in Access prints out all records, I attempted to create a report first. The form on which the report is based has multiple subforms and many calculated fields, (which is why I was hoping to print the form itself). I added a routine to print the report as below:

    Private Sub cmdPrintProposal_Click()
    ' Print out the report based on this form
    '===================================================

    Dim strWhere As String
    If Me.Dirty Then 'Save any edits.
    Me.Dirty = False
    End If
    If Me.NewRecord Then 'No information to print
    MsgBox "Select a record to print"
    Else
    strWhere = "[company_ID] = " & Me.company_id
    DoCmd.OpenReport "rptFrmProposedEvent", acViewPreview, , strWhere
    End If
    End Sub

    On the bright side, it prints out the report with just the single record. Yeah. On the dark side, all the calculated fields at the bottom of the form are left blank (not 0, mind you, but blank). These are unbound fields...does the fact that they aren't bound preclude them from displaying on the report?

    Thanks for any assistance.
     

    Attached Files:

  2. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    What is the report based on? Is it based on a query?
     
  3. NewbieButTrying

    NewbieButTrying Thread Starter

    Joined:
    Nov 16, 2011
    Messages:
    5
    I built it directly from the form by selecting the form and doing a "save as" and "save object as" report. I wan't to avoid the need to build all the separate queries needed to get the underlying data.
     
  4. NewbieButTrying

    NewbieButTrying Thread Starter

    Joined:
    Nov 16, 2011
    Messages:
    5
    PDF of the report attached.
     

    Attached Files:

  5. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    You are probably correct as to why those fields are not printing out because they are unbound text fields. Basing a report on what is on what you have on the form displayed would be easy enough to accomplish and making reports do what you want it actually pretty easy.
     
  6. NewbieButTrying

    NewbieButTrying Thread Starter

    Joined:
    Nov 16, 2011
    Messages:
    5
    Perhaps you could expand on how I could base the report on what is on the sample report included? It requires, for example, gathering recordsets of information from multiple tables, performing summations, performing calculations depending on the radio button selected, (discounts, etc) and then creating grand totals. With my limited experience, I did not find the process simple at all.
     
  7. Rockn

    Rockn

    Joined:
    Jul 29, 2001
    Messages:
    21,334
    I am sure you already have the queries for what that form is based on and all you would have to do is create a report based on the query used in the main form and add sub reports based on the sub forms you also have on that form. You would fire off the report in the same way you are trying to do now using the companyID as the criteria.
     
  8. NewbieButTrying

    NewbieButTrying Thread Starter

    Joined:
    Nov 16, 2011
    Messages:
    5
    Thanks, Rockn. Didn't realize (doh!) that you could use subreports in a similar fashion to subforms. All learning is good learning. Will do some reconfiguring.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1027158

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice