Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print first record of a subform

Status
Not open for further replies.

Leventcos21

Technical User
Oct 7, 2004
77
US
Hi,
I have a filter of employee names that belongs to a form/subform. The employee names are a subform and sometimes there maybe 1,2,3 names in that subform.

I am trying to print out a report that selects a name from a combobox. I am only trying to print the records of the employee that are on the subform 1 record.

What I am getting is the employee in either 1, 2, or 3.

When I run the query with the employee's IDnumber, I get the result that I want. Here is the code for the unbound form that is doing the filter. Thank you in advance

If Not IsNothing(Me.cboProcess) Then
' .. build the predicate - must use subquery
varWhere = (varWhere + " AND ") & "(NcrNumber IN " & _
"(SELECT NcrNumber FROM tblOwnerDetail WHERE " & _
"ProcessID = " & Me.cboProcess & "))"
End If
 
Have you tried to play with the TOP 1 predicate ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top