Results 1 to 4 of 4
  1. #1
    chrisrach3 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    6

    creating reports from query from form field

    I'm in commercial real estate and I have two forms I use: 1) Listing Leads and 2) Listings. I have around 50-100 leads for each listing I have, and I have about 20 listings, and I'm trying to click the "report" button on my "Listings" form and have it bring up all of the leads for that particular listing that's shown on the form. I have a "Listing Leads Query" that I use for the report.



    It worked GREAT before I switched from 2010 to 2007 (long story) but for some reason the code didn't adapt correctly. Any ideas? Here's what I currently have under the "where condition":

    [Reports]![Listing Leads Report]![Property Name]=[Forms]![Listings]![Property Name]

    Thanks
    Chris

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    What happens - error message, wrong results, nothing?

    Where do you have this criteria - in a query or code? Show complete SQL statement or the code procedure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    chrisrach3 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    6
    Quote Originally Posted by June7 View Post
    What happens - error message, wrong results, nothing?

    Where do you have this criteria - in a query or code? Show complete SQL statement or the code procedure.
    Ah, sorry. It brings up the report just great, but it doesn't populate it with anything whatsoever. Here's the code:


    Option Compare Database

    Private Sub Form_Open(Cancel As Integer)

    End Sub


    Private Sub ProspectName_AfterUpdate()

    [Listing Leads].Email = ContactsQuery.ProspectName.Column(2)

    End Sub

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    None of that code shown opens the report nor does it show the criteria expression. Just a line that saves data to a field. Does this form remain open when you call for the report to open? Probably need to commit the data edit to table by saving the record. Use: DoCmd.RunCommand acCmdSaveRecord.

    Data is not committed until close form, move to another record, or run code to save.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Creating reports for table column from form
    By ryanwales in forum Reports
    Replies: 14
    Last Post: 10-13-2011, 12:48 PM
  2. Replies: 1
    Last Post: 06-20-2011, 03:56 PM
  3. Creating a query with a self-dependent field
    By lottrup in forum Queries
    Replies: 0
    Last Post: 06-20-2011, 04:30 AM
  4. Creating SQL query with one-to-many field
    By slaterino in forum Queries
    Replies: 2
    Last Post: 09-08-2010, 07:56 AM
  5. Creating multiple reports from one Query
    By Mike Cooper in forum Reports
    Replies: 5
    Last Post: 04-24-2006, 05:00 PM

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