DLookup/Aggregate Domain Functions

velcrowe

Registered User.
Local time
Yesterday, 23:16
Joined
Apr 26, 2006
Messages
86
Is there any way to lookup items using DLookup or other functions that will return an array of values not just the first value found. Example: I have three employees in a complaint query. I am using Dlookup to identify them on my employee form. When I get to the same employee/employee id on my employees form, I have a label that flashes red to flag me that this employee appears on that complaint query. The problem that I am having is that it only flashes for the first employee found in the query, and the label only flashes for that one person. I would like the label to flash for the other two employees because the function should see that they are in the query results as well. Help please?!!!
 
I DLookup isn't a query, so it's not returning query results. DLookup provides a single response only, as you've noticed. You'd have to use a proper query to return the results, as in:

SELECT * From YourEmployeeTable WHERE ComplaintFlag=True;
 
To be more precise, DLookup is a function that performs a query but, as Moniker points out, isn't itself a query.

"Arrays" from a query? NEVER happens. Instead, you could open a query as an internal recordset and get back all of the records matching your situation, but you would need to do some VBA programming to get each result in turn.

In general, arrays and Access don't go together THAT well. (Though there are exceptions to every rule...) If you are thinking "array" you could already be making a design-level mistake.

Please don't take this wrong, but usually when someone asks this forum for array information with Access, they have some sort of repeating group in a record such that the database isn't even in first-normal form with respect to that table. Are you familiar with database normalization? We need to know that in order to properly gauge the answer we can give you.
 

Users who are viewing this thread

Back
Top Bottom