Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post

    I set up a query just to view specific work done by a manager. If the manager goes into the query and sees a record that she highlights and wants to print a form out by just selecting the record in datasheet view (from a query) is it possible. Thank you.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    That is not possible. It can be done from a form based on the query. I wouldn't print a form, though - forms are intended for viewing and editing data on-screen, not for printing. You should design a report based on the query, and view or print that, using a bit of VBA code.

    The idea is as follows: the user navigates to the record on the form that he or she wants to print.
    The form contains a command button cmdPrint with an On Click event procedure that resembles the following:

    Code:
    Private Sub cmdPrint_Click()
      DoCmd.OpenReport ReportName:="rptMyReport", WhereCondition:="ID=" & Me.ID
    End Sub
    rptMyReport is the name of the report to be printed. and ID is the name of the field that uniquely identifies the records. I have assumed that it is a number field.

  3. #3
    New Lounger
    Join Date
    May 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='Danielle' post='774357' date='08-May-2009 14:36']I set up a query just to view specific work done by a manager. If the manager goes into the query and sees a record that she highlights and wants to print a form out by just selecting the record in datasheet view (from a query) is it possible. Thank you.[/quote]


    Thank you.

  4. #4
    2 Star Lounger
    Join Date
    Nov 2002
    Location
    Mt. Olive, North Carolina, USA
    Posts
    170
    Thanks
    8
    Thanked 0 Times in 0 Posts
    [quote name='Danielle' post='774357' date='08-May-2009 14:36']I set up a query just to view specific work done by a manager. If the manager goes into the query and sees a record that she highlights and wants to print a form out by just selecting the record in datasheet view (from a query) is it possible. Thank you.[/quote]
    What if you displayed a form in datasheet view based on that query that the manaager could click a field then the on click event would print a report where the report equals the clicked field?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    [quote name='imincorrigible' post='774456' date='09-May-2009 20:01']What if you displayed a form in datasheet view based on that query that the manaager could click a field then the on click event would print a report where the report equals the clicked field?[/quote]
    I wouldn't use the On Click event - that would cause the report to be printed each time the user clicks in the field, even if only by accident. You could use the On Dbl Click event - that requires deliberate action.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •