Multiple Criteria for access DLookup

By jim ·
I'm back yet again with a new and intriguing set of problems.
I am building a fancy report and Come to find out you cannot use SQL to return one simple number in a text box because even though you know you will write the statement to return only one answer everytime, access doesnt understand that so we can do a domain aggregate thing with DLookup.
OK fine I have to do alot of them but still OK, here is my issue
I can get DLookup to give me what I want if i type into each control source the criteria that I want to return.

I want to lookup a number from a recordset but there are two things that make the number unique date and strain. strain is easy to cough up in the right place because i will hard code that into the control source dlookup, the part that is killing me is the date
I can get a dlookup to give me accurate results based on multiple criteria, but how can i get that to include the date for which I am running this report.
I do enter the date parameter each time i open the report.

Here's what i got so far

=DLookUp("csQuantity","SpawnScheduleCulSpawn","csstrain='AC-PA'" & " AND week = #4-29-07#")

That returns the answer i want, but i have 50 of these text boxes in one report so i cant go through and write the date in each one.

how can i make the part following " AND week =" dynamic so that it runs the date that i entered as the parameter for the report?

Thanks in advance!

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums