Help with dlookup

Clueles

New member
Local time
Today, 12:58
Joined
Oct 6, 2018
Messages
1
I’m trying to use multiple criteria and I can’t get the syntax right for the life of me. I have no training but have managed to create a decent database.

I want to fill in a field on a form called waa based on the value on my hours tally table.
=dlookup([total hours],[hours tally], [hours tally].[rep]=1 and forms!waa!queuedate = [hours tally].[date worked]
 
Probably should include the forms reference using square brackets around each component like you did for [hours talley].[rep]

Also, your parentheses are unbalanced. You need a closing parenthesis after the [Date Worked] element.
 
You also need :
a) quotes around each part of the expression
b) date delimiters (#) for date field
c) final bracket as already mentioned

Code:
=DLookup("[total hours]","[hours tally]", "[hours tally].[rep]=1 AND Forms!waa!queuedate  = #" & [hours tally].[date worked] & "#")

Lots of help available online. For example, see http://access.mvps.org/access/general/gen0018.htm and http://allenbrowne.com/casu-07.html
 
Shouldn't the reference to form control/field be concatenated instead of the table field?

=DLookup("[total hours]", "[hours tally]", "[rep]=1 AND [date worked] = #" & Forms!waa!queuedate & "#")
 
June

Oops. Looks like in fixing other issues I also missed something.
Yes I agree with your new version.
 

Users who are viewing this thread

Back
Top Bottom