Results 1 to 4 of 4
  1. #1
    drf3794 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    2

    Select line from a form for a report

    Hello, I currently have a form that shows each customer and the workorders on a subform that are entered for that customer and another subform that shows each item from the workorder that is highlited on the above subform. My problem is I would like my command button to select the workorder line that is highlited from the subform and display that information on my report. I can get the button to display the report, but with all of the data in the workorder table not just the line item in the subform. Any help would be appreciated.



    Sincerely,
    David

  2. #2
    haquocquan is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    3
    Quote Originally Posted by drf3794 View Post
    Hello, I currently have a form that shows each customer and the workorders on a subform that are entered for that customer and another subform that shows each item from the workorder that is highlited on the above subform. My problem is I would like my command button to select the workorder line that is highlited from the subform and display that information on my report. I can get the button to display the report, but with all of the data in the workorder table not just the line item in the subform. Any help would be appreciated.

    Sincerely,
    David
    When you select item (record) in subform, the textbox will get value of that record. You can filter by this value.

  3. #3
    drf3794 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    2
    Hello, Thankmyou for the post. Do you know what the "where clause" for the button would be? Or how do I find what the value of the line in the subform is? There are anywhere from 1 to 20 lines showing in the subform at any time. I need the value from the line that is selected in my subform. Thanks for the help.

    David

  4. #4
    haquocquan is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    3
    For example:
    Your source for subform includes fields: ID(text), IDNAME, ....
    And textbox in subform named: ID(text), IDNAME,....
    And source for report is the same as subform.
    command button code:

    docmd.openreport "reportname", acpreview,,"[ID]='"& forms!mainform!subform!ID &"'"

    ---------------------------
    Sorry for not clear. My English is not good.

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

Similar Threads

  1. How to do line by line compare of VB code?
    By Buakaw in forum Access
    Replies: 2
    Last Post: 02-14-2011, 11:46 PM
  2. Adding line numbers to a purchase order report
    By jordanturner in forum Reports
    Replies: 1
    Last Post: 12-08-2010, 08:25 AM
  3. Eliminate line breaks in exported report
    By thekruser in forum Reports
    Replies: 3
    Last Post: 09-28-2010, 08:57 PM
  4. Replies: 0
    Last Post: 11-23-2009, 09:19 PM
  5. Replies: 3
    Last Post: 03-24-2006, 08:40 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