Results 1 to 2 of 2
  1. #1
    jamil_kwi is offline Novice
    Windows XP Access 2003
    Join Date
    May 2010
    Posts
    8

    Exclamation Print Report by clicking record

    I have Main form with two sub form for Gatepass of the employees.
    All the forms have relationship with the field name [Civil ID#].
    Main form has only one field with name [Civil ID#]
    The 1st sub form has different fields:
    [Civil ID#], [Name], [Occupation] etc…
    The 2nd sub form has following fields:
    [Civil ID#], [Gate pass starting Data], [Gate passes Ending Date] etc...


    There are more than one Gate passes in 2nd sub form for one employee in different dates like:

    Civil ID# Gatepass starting Date Gatepass Ending Date
    12345 2009/06/10 2009/12/30
    12345 2010/01/01 2010/06/30

    I want to print a report by clicking specific record in 2rd subform. For example I want to print the gatepass report for the Gatepass starting Date “2010/01/01” Gatepass Ending Date “2010/06/30”, then automatically print out a report after flirting information from other forms.

    I made a query with the help of relation tables and the report is giving information as i required, But the problem is I have to enter [Civil ID#] and [Gate pass staring Date], [Gate pass Ending Date] then it filter the record and preview the record. I just want to click the required record of the Gatepass duration in the 2nd Subform it should autometically filter the information and preview the report.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    in the click event of the record (any field?), code as below:

    Code:
    private sub Civil_ID_click()
        DoCmd.OpenReport "Your Report Name", acViewNormal, , "[Civil ID#]='" & Civil_ID &"' and [Gatepass starting Date]=#" & Gatepass_Starting_Date & "# and [Gatepass Ending Date]=#" & Gatepass_ending_Date & "#"
    "
    end sub

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

Similar Threads

  1. Clicking on Form Background Adds New Record?
    By swimmermx in forum Forms
    Replies: 3
    Last Post: 08-03-2010, 12:14 PM
  2. Clicking on label adds new record?
    By swimmermx in forum Forms
    Replies: 1
    Last Post: 07-25-2010, 07:03 AM
  3. Clicking on label opens up new record
    By swimmermx in forum Forms
    Replies: 2
    Last Post: 07-20-2010, 03:58 PM
  4. Replies: 3
    Last Post: 02-19-2010, 04:19 PM
  5. Print a specific record report from a form
    By cynthiacorley in forum Reports
    Replies: 27
    Last Post: 02-08-2010, 06:34 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