Full Version: dlookup
UtterAccess Discussion Forums > Microsoft® Access > Access Queries
docmiller10
Is there any way I can use a list in the condition section of dlookup command? Example

dlookup("sum(total])","tbltest',"[task] in ('a','b','c')")
Jerry Dennison
Not that I'm aware of. You can create a query with the criteria and use DLookUp() against it.
wth54
You could also probably use 'Like' in the criteria section with a range of values or a characterl ist. I've used it from time to time in 2002. ex. "[task] like '[a-c]'"
Jerry Dennison
I just thought of something. DLookUp() will only return a single record's worth of a value so what purpose could possibly be served by trying to have multiple criteria? What exactly are you trying to do?
wth54
True. I've used it to just test for the existence of a record that matches a range of criteria before calling different subs rather than cobbling together a long list of "or" values. But I can't think of much you could use if for other than that.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.