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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dlookup as sort field on a report?

Status
Not open for further replies.

JaneInMA

Programmer
Nov 3, 2000
104
US
Is it possible to use a Dlookup as a sort and Grouping category in a report. I have a report that brings in an employee's ID# but I would like it to sort by the employee last name. I know the lookup works (I tested it in a temporary report (as a control source for a field) but it doesnt work as a sort field. Other suggestions are welcome but the users are just plain confused at the sort order (by ID#) at the moment.
=DLookUp("Expr1","qryActiveEmployeeFullNames","SOP_txt_PRReviewerID = EMP_txt_EmplID")
By the way I inherited Expr1 as a query field and would have to rewrite the Db to get rid of it.
 
Is LastName a field on the report? Are you using the "Grouping And Sorting" window in the reports design view?

Just curious... B-) ljprodev@yahoo.com
ProDev
MS Access Applications
 
Last name is not a field, the field brought in is the ID number and I use a lookup to present that as a name to the user. this application is used across a WAN and for 50% of the users is very slow, If I link the query to the employee table to bring in the name it slows the query down to taking ages to run. and yes I am trying to sort using the grouping and sorting window.
 
Type the actual DLookup expression in the Sorting And Grouping window instead of a field name. Use the equal sign. ljprodev@yahoo.com
ProDev
MS Access Applications
 
I was actually doing that and it doesnt work!!
Hence the request for help.
 
I am using Access97. If you are using the same I can email you a copy of what I did to get it to group based on an expression. ljprodev@yahoo.com
ProDev
MS Access Applications
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top