UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Dlookup, Access 2016    
 
   
mike60smart
post Oct 19 2019, 12:30 PM
Post#1


UtterAccess VIP
Posts: 13,465
Joined: 6-June 05
From: Dunbar,Scotland


Hi Everyone

The following DLookup is returning no value when it should return one.

Can anyone spot where I am wrong?

Any help appreciated

=DLookUp("Balance","tblStudentFeeCollection","[StudentID] = " & [StudentID] And [MonthID]=" & [MonthID] & ")

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
pere_de_chipstic...
post Oct 19 2019, 12:37 PM
Post#2


UtterAccess Editor
Posts: 10,512
Joined: 8-November 07
From: South coast, England


Hi Mike
Check your quote marks;
"StudentID = " & [StudentID] & " AND [MonthID] = " & [MonthID])

HTH

--------------------
Warm regards
Bernie
Go to the top of the page
 
tina t
post Oct 19 2019, 12:38 PM
Post#3



Posts: 6,150
Joined: 11-November 10
From: SoCal, USA


hi Bob, control references must always be outside the string(s) in the criteria argument, hon, as

=DLookUp("Balance","tblStudentFeeCollection","[StudentID] = " & [StudentID] & " And [MonthID]=" & [MonthID])

the above assumes that both fields StudentID and MonthID are Number data types in tblStudentFeeCollection. if they're Text data types, the syntax would be

=DLookUp("Balance","tblStudentFeeCollection","[StudentID] = '" & [StudentID] & "' And [MonthID] = '" & [MonthID] & "'")

hth
tina

EDIT: ha, Bernie beat me to it. hi, Bernie! :)
This post has been edited by tina t: Oct 19 2019, 12:42 PM

--------------------
"the wheel never stops turning"
Go to the top of the page
 
mike60smart
post Oct 19 2019, 01:40 PM
Post#4


UtterAccess VIP
Posts: 13,465
Joined: 6-June 05
From: Dunbar,Scotland


Hi Bernie

Spot on yet again

Many thanks to both yourself and Tina

cheers.gif
pompom.gif

--------------------
Hope this helps?

Mike

Get happiness out of your work or you may never know what happiness is.

Go to the top of the page
 
pere_de_chipstic...
post Oct 20 2019, 09:26 AM
Post#5


UtterAccess Editor
Posts: 10,512
Joined: 8-November 07
From: South coast, England


yw.gif

Tina and I are always pleased to help.

Hi Tina wavehi.gif
I may have beaten you to it, but you gave the fuller answer thumbup.gif !

--------------------
Warm regards
Bernie
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    13th November 2019 - 03:52 PM