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: Access 2007 - Print single record selected on continuous form

Discussion in 'Business Applications' started by MuddyTurtle, Jun 30, 2010.

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

    MuddyTurtle Thread Starter

    Joined:
    Jun 30, 2010
    Messages:
    16
    Hi! I'm new to the forum, and not as knowledgable about Access 2007 as I thought I was when I started this project, so please bear with me as I trip over words and concepts!;)

    I have a master form set up with synch'd combo boxes. The 2nd combo box displays results in a continuous form - showing a shortened version (query'd) of the matching records.

    I need to be able to select a record in the continuous form and view +/ print the chosen record from the main table.

    I created a report to display the record.
    I created a command button to open/view the report but it opens to the 1st record in the entire database instead of the record selected in the continuous form.

    How do I get the command button to open up the full record indicated by choosing the shortened version in the continuous form?

    Hope this makes sense. Any suggestions / thoughts are welcome! Thanks in advance.
     
  2. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    MuddyTurtle, welcome to the Forum.
    Your question makes complete sense, the easiest way to achieve what you want to create a Query for your report.
    In the Key field enter this in the First Criteria Row.
    forms![Formname]![Subformname]![Key Field Name]
    where Formname is the name of your mainform, Subformname is the name of the subform as the mainform sees it and
    Key Field Name is the name of the key field on the subform that identifies the Record that you are on.
     
  3. MuddyTurtle

    MuddyTurtle Thread Starter

    Joined:
    Jun 30, 2010
    Messages:
    16
    OPB, Thanks for the rapid response!:)
    That seems to have done the trick! It took me a bit to work through where to put what so in case anyone else comes across this question here is what I did.

    I created a query based on the master table for the database - I named it SelectRecordQuery
    For the "Field" I used the primary key which is my identifier for the record and also shows up on my subform query results.
    In "Criteria" I used the code provided by OBP (Thanks!)
    For the control button to view the record, in the property sheet > event tab > "on click" embedded macro
    Action:"Open Report"
    Report Name: name of sub report
    Filter Name: SelectRecordQuery

    WoooHooo!:D
     
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!

Loading...
Thread Status:
Not open for further replies.

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