By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,730 Members | 1,648 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,730 IT Pros & Developers. It's quick & easy.

MS Access Report - Dlookup multiple criteria

P: 3
I have a database that tracks drawings issued to the contractor. I have created a report listing all drawings issued per consultant per contract. This report includes a Dlookup formula that references a query which counts the number of drawings issued.

I have been using the below formula with success for about a year now:

=DLookUp("CountOfDrawingNo","QRYDwgCount","IssuedB y = '" & [IssuedBy] & "'")

The problem I am now getting is that a new contract has been created however a consultant used on a prior contract is also issuing drawings for this new contract. So the above formula is bringing forward the first instance/contract that this consultant issued drawings for as opposed to the current job. I therefore need to add a second criteria to the formula but I keep getting either #Error as the result or nothing at all.

I really need help. This is what I have

=DLookUp("CountOfDrawingNo","QRYDwgCount","[IssuedBy] = '" & [IssuedBy] & "' And [ContractName]=" & [ContractName] & "'")

Iím getting an #Error result for this formula.
The fields in the QRYDwgCount are:

ContractName
IssuedBy
CountOfDrawingNo

Several consultants can issued drawings for one contract. It is only now that I have a consultant in twice on two different contracts that I have encountered a problem.

Really really need help figuring this out and any assistance offered is appreciated.
Mar 12 '15 #1
Share this Question
Share on Google+
3 Replies


Seth Schrock
Expert 2.5K+
P: 2,951
Please use CODE tags when posting code as it is required by site rules and it makes the code a bunch easier to read.

It looks like you forgot the single quote before your contract name value. Try the following:
Expand|Select|Wrap|Line Numbers
  1. =DLookUp("CountOfDrawingNo","QRYDwgCount","[IssuedBy] = '" & [IssuedBy] & "' And [ContractName]= '" & [ContractName] & "'")
Mar 12 '15 #2

P: 3
Thanks! Worked.

Sorry about the Code tags - not sure how to do that as I'm still somewhat of a novice.

Thanks again.
Mar 12 '15 #3

Seth Schrock
Expert 2.5K+
P: 2,951
No problem.

For code tags, just click the [CODE/] button at the top of your posting box and place your code between the opening and closing tags.
Mar 12 '15 #4

Post your reply

Sign in to post your reply or Sign up for a free account.