Hi all,
I am trying to get the following Dlookup to work and its not
=DLookUp([qry123]![Total],[qry123],"Week =" & [qry123].[Week] And "HomeTeam=" & [qry123].[Team])
Has anyone got any ideas please
Many thanks in advance
Steve
Hi all,
I am trying to get the following Dlookup to work and its not
=DLookUp([qry123]![Total],[qry123],"Week =" & [qry123].[Week] And "HomeTeam=" & [qry123].[Team])
Has anyone got any ideas please
Many thanks in advance
Steve
Sometimes you will get a better understanding if you google what you are trying to do first - e.g. dlookup - before asking a question.
there are a number of things wrong with the syntax and not quite clear how you are using it, so better you learn how dlookup works, so take a look at this link.
https://support.office.com/en-us/art...ad=US&fromAR=1
in particular, look at the last example which sounds like it is close to what you are trying to do
If still a problem, come back with your revised code.
Ajax
Many thanks for your help and i have read the page and changed my code to the following:-
=DLookUp("[Total]","qry123","[Week] =" & [Forms]![frmFixtures]![Week] And "[Team] =" & [Forms]![frmFixtures]![HomeTeam])
and it works sort of as every record in the form has the same value and it definatley shouldnt
any help
Many thanks again in advance
Steve
Find a way (either with Debug.Print or a MsgBox) to display: "[Week] =" & [Forms]![frmFixtures]![Week] And "[Team] =" & [Forms]![frmFixtures]![HomeTeam]
It may be because your quotes aren't quite right
=DLookUp("[Total]","qry123","[Week] =" & [Forms]![frmFixtures]![Week] & " And [Team] =" & [Forms]![frmFixtures]![HomeTeam])
Also, if this code is in the frmFixtures form then all you need is
=DLookUp("[Total]","qry123","[Week] =" & [Week] & " And [Team] =" & [HomeTeam])
Next, just to confirm, Team is a number and not text?
finally, please clarify
Is your form single or continuous? is it a subform? - please provide some example data and/or screenshot to illustrate the problemit works sort of as every record in the form has the same value and it definatley shouldn't
Team/HomeTeam certainly sounds more like a Text Field than a Number...and even Week could be Numerical or Text. We really need to know the Datatypes of each, in order to advise you.
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007
Ajax and all,
Many thanks for your reply, and sorry for the delay posting very busy with work and home life
I have tried the following and it works
=DLookUp("[Total]","qry123","[Week] =" & [Forms]![frmFixtures]![Week] & " And [Team] =" & [Forms]![frmFixtures]![HomeTeam])
and yes Team is a Number
Many many thanks for your help
Steve
'work and home life' has a way of doing that!
Glad you got it working!
Linq ;0)>
The problem with making anything foolproof...is that fools are so darn ingenious!
All posts/responses based on Access 2003/2007