Results 1 to 10 of 10
  1. #1
    Join Date
    Oct 2004
    Posts
    31

    Unanswered: Simple? Print one record only in report design.

    I am using a table for a report.
    If I want to print just one record from that table using the designed report, how do I do it. I'm not familiar with SQL expressions.

    I have set up a form based on the TABLE, where 2 fields of a single record can be selected from a combo box - but again, I have no idea how to make that apply to print JUST that result for that one record.

    Can you pls help.
    Thanx.
    Jillian

  2. #2
    Join Date
    Oct 2004
    Posts
    31
    I would have thought this probably had a simple answer?
    Can anyone help? My boss is back tomorrow.
    Thanx.
    Regards,
    Jillian

  3. #3
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    You could always create a query to sort for a particular record and then just base your report on that query.

  4. #4
    Join Date
    Oct 2004
    Posts
    31
    What is the advantage in that - I need a really simple way to do a query - can I do a query through a form or something? I need to make it easy for end-user use.
    I want to allow print form for choices:
    1. A person (name) (with all projects assigned to this person - so only need a seach on the person.
    2. A person (name) PLUS choose a specific project for that person.
    3. A choice of showing all people assigned to a project.

    I need these choices to be clear and easy for the end user to see in print preview, then print if necessary.

    I think I tried using a query to do this, and ended up with my names of the cells on the report not working.

    Thanks for your help.
    Hope you can help further.
    I appreciate it.
    Jillian

  5. #5
    Join Date
    Sep 2004
    Location
    Raleigh, NC
    Posts
    146
    Give this a try:

    Identify the specific criteria on which you would like to base the report. (Let's say for example that we only want to print a report for John Smith and that we have a field in our table called [LastName]) Create a new query and in the criteria field for [LastName], place the name of the control on your form that is bound to the [LastName] field. (Let's say it's a textbox called "LastNameBox" and that it's found on form "Employees".) The criteria field for [LastName] would look something like:

    [Forms]![Employees]![LastNameBox]

    Save the query and create a new report based on it. You can then create a command button on the form that when clicked opens the report and runs the query. If the button was called "Execute".. the code would look like this:

    Private Sub Execute_Click()
    On Error GoTo Err_Execute_Click
    Dim stDocName As String
    stDocName = "ReportNameHere"
    DoCmd.OpenReport stDocName, acPreview
    Exit_Execute_Click:
    Exit Sub
    Err_Execute_Click:
    MsgBox Err.Description
    Resume Exit_Execute_Click
    End Sub

    Using this method, you could use the navigational buttons to move between records and generate individual reports on the fly by simply clicking the "Execute" button.

  6. #6
    Join Date
    Oct 2004
    Posts
    31
    Sorry - computer problems!
    Last edited by Jillian; 10-15-04 at 00:21.

  7. #7
    Join Date
    Oct 2004
    Posts
    31
    Sorry - duplicated post (actually triplicated!) - comptuer problems.
    Last edited by Jillian; 10-15-04 at 00:22.

  8. #8
    Join Date
    Oct 2004
    Posts
    31
    Thank you, I'll try.
    I appreciate very much you taking the time to answer.
    Regards,
    Jillian

  9. #9
    Join Date
    Oct 2004
    Posts
    31
    It worked very simply!
    Needed only minimal changes.
    Thank you so much!
    Regards,
    Jillian
    Have a great Friday!

  10. #10
    Join Date
    Oct 2004
    Posts
    31
    Sorry, I have another related question.
    I enter the person's name in the pop up box, then I get a box for project, and enter that. It pulls up the appropriate record - but what happens if I want ALL records for that person, regardless of project, AND/OR how do I get ALL records for a particular PROJECT?
    Thanx.
    Regards,
    Jillian

Posting Permissions

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