View Full Version : Return search criteria in report


Hayley Baxter
10-11-2002, 03:10 AM
Hello Everyone

I would like to return what the user(s) select on a search form in the report. I can get this to work by using = [Fieldname] BUT the combo box on the search form is hiding the bound column and looking up column 2 so how do I therefore get the report to also return column 2 and the not the ID no which I am currently getting in the report.

Any advice?

Thanks
Hay

wh00t
10-11-2002, 04:34 AM
have u tried using DLOOKUP for the report field?

Hayley Baxter
10-11-2002, 06:10 AM
I have tried this now but it's not working. I've never used dlookup before here goes........

It's asking for a parameter with what I've tried


=DLookUp("[CategoryName]","tblProspects","[CategoryID]=" & [CategoryName])

I have a search form which is a query by form so what I want is for the Category name chosen in the categoryID combo on my search form to display Category Name 1 or 2 etc of whatever is selected.

Can anybody help?
Thanks

wh00t
10-11-2002, 06:31 AM
=DLookup("[CategoryName]", "tblProspects", "[CategoryID] =" & Reports![your report name]!CategoryID)

wh00t
10-11-2002, 06:36 AM
for the criteria in the query for catagory name enter this
[Forms]![form name]![CategoryName]

then in the after update event use
DoCmd.OpenReport "report name", acPreview
to open the report

Hayley Baxter
10-11-2002, 06:39 AM
Who's clever then?? Thank you so much. This has been one of those days where nothing has went right I'm glad it's Friday.

Have a great weekend
Hay