Pulling data from a query based on criteria

mikehextall

Registered User.
Local time
Today, 04:43
Joined
May 22, 2012
Messages
14
Hi

Im having a problem pulling some data from a query to populate text boxes in a form

Text27 = DLookup("'SumOfSumOfDocCount'", "SumTotalPerf", "DateReceived=" & Forms.Tracker.Text23.Value & "AND 'BookedInID'=" & Forms.Tracker.BookedInID.Value)

Im trying to pull the sum of document count from the SumTotalPerf query where the datereceived in the query matches the date on the form and the BookedInID in the query matches the BookedInID on the form, at the moment Text27 just displays as blank with no error messages displayed so I am lost as to what im doing wrong, Ive double checked all the spelling for my column names etc and all is correct.

Please can someone help.

Thanks
 
Thanks for your help but no it hasnt really helped, still getting no value
 
What does your formula look like now?
 
Text27 = DLookup("SumOfSumOfDocCount", "SumTotalPerf", "DateReceived = #" & Me.Text23 _
& "# AND BookedInID = '" & BookedInID & "'")
 
Personally I wouldn't incorporate line breaks until I had it working, to eliminate that as a potential problem. The ID is text? Can you post the db here?
 
Then as the link shows, you don't want the single quote delimiters.
 
Text27 = DLookup("SumOfSumOfDocCount", "SumTotalPerf", "DateReceived = #" & Me.Text23 & "# AND BookedInID = " & BookedInID & "")

Not working, however when I use the code below I can pull the value that matches the date but canr add the BookedInID as a criteria aswell??

Text27 = DLookup("[SumOfSumOfDocCount]", "SumTotalPerf", "[DateReceived] = Forms.Tracker.Text23")
 

Users who are viewing this thread

Back
Top Bottom