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

Sorting by a control in a report

Status
Not open for further replies.

idcowboy

Technical User
May 30, 2002
34
US
I have created a report to do billings for a company and I want to sort by the zip code so the smallest comes out first and then the largest and so on, my problm is the zip code in the report is a control (a dlookup fuction) any help would be great thanks - Justin
 
in your sort criteria, put =dlookup (blah blah). That works for me.

ChaZ
 
I will give it a try, sounds too easy
 
I tried what you said and came aout w/ a bad result, I prob. dident give you enough info. the report it is pulling is an invoice so it shows the sponsor on the top w/ mailing address and ZIP and in the detail it has all of the bowlers that he or she sponsored for example top smith sponsored 30 bowlers it will show below him. When I tried what you suggested I got one sponsor and all of the bowlers any other ideas
 
It sounds like you are using the sort field as a group. If so, that may be the problem.

You can use your dlookup as a sort criteria within a group though.

Hopefully I am understanding.

ChaZ
 
Hey ChaZ do you have a sec to take a look @ it Go to ftp://24.117.238.200/ and log in as chaz w/ password chaz let me know thanks
 
Hi. I took a look and found a hidden control that reads

=DLookUp("zip","sponsor","sname=[sponsor]![ClientID]") & " Zip"

This control looks like its looking for a Zip field in a the table Sponsor, based on Sname = as it said. It returns a null value, and this may be because that table has no field called sname. There is a field called fname, but I am not sure what the intent is, so I am not sure.

Either way, if we fix the dlookup, then we can sort by it.

Hope that helps.

ChaZ
 
if you look below the logo and next to the name and address of the sponsor you will see a small box it is the "sname" it is hidden on the report thanks again
 
I see the Sname, but the sname has Sponcer Name as a control source, and it's returning a null value, so your dlookup is also returning a null value.

ChaZ
 
I just pulled it up and it shows a value you may need to go to the seconded page because the first page has no sponsor, it is pulling a number corresponding to the name of the sponsor in the pledge form
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top