Results 1 to 3 of 3
  1. #1
    greatwhite is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2019
    Location
    Ottawa, ON
    Posts
    56

    Reports and Forms


    OK I have a a Form called frmShipsAudit.
    Within this from I have a SubReport with to reports embedded RptShipEquip and RptShipPanels. I want to programmatically change the recordsource (same data just a different clause)

    So I tried the code below but get this error MS Access error 2465 can't find the field report referred to in your expression .

    Me!RptShipEquip.Report.RecordSource = strSQl
    Me!RptShipPanels.Report.RecordSource = strSQl

    This works fine for an SubForm I have but not for reports.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    dont connect forms to sql,
    connect them to queries.

  3. #3
    greatwhite is offline Advanced Beginner
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2019
    Location
    Ottawa, ON
    Posts
    56
    I was passing the sql string just because it was easier to modify the From and where clause. Got it to work when I took it out of the Subform. But I was hoping I could manipulate reports to collapse if it had no data so as not to leave gaps between reports. I guess there is no easy way of doing that in Access.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 04-15-2015, 11:22 AM
  2. Using reports in forms
    By Historypaul in forum Forms
    Replies: 3
    Last Post: 11-16-2014, 01:10 PM
  3. Reports and Forms
    By GaryG73 in forum Access
    Replies: 3
    Last Post: 11-21-2011, 11:45 AM
  4. Forms and reports
    By g2rules in forum Access
    Replies: 0
    Last Post: 03-08-2011, 09:09 AM
  5. Forms and Reports
    By nacho in forum Forms
    Replies: 3
    Last Post: 04-17-2010, 01:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums