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.
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.
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:
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
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.
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?