Dlookup problem

  • Thread starter Thread starter Jean-Paul
  • Start date Start date
J

Jean-Paul

=DLookUp([Naam_bedrijf];[Afspraken];[Aankomst]=800)

returns a #Name error

I use a Dutch version of Access
I rewrote teh fieldname-tablename 1000 times, nothing changes?

What's wrong?
 
Use quotes around the expressions.

You might also try commas instead of semicolons.
=DLookUp("Naam_bedrijf", "Afspraken", "Aankomst = 800")

If Aankomst is a Text field (not a Number field), you need extra quotes:
=DLookUp("Naam_bedrijf", "Afspraken", "Aankomst = ""800""")
Explanation in:
Quotation marks within quotes
at:
http://allenbrowne.com/casu-17.html
 
Dlookup takes string parameters
=DLookUp("[Naam_bedrijf]","[Afspraken]","[Aankomst]=800")
 
Great...
I need to add a date field to...
What should be the correct syntax?
I thought:
=DLookUp("[Naam_bedrijf]","[Afspraken]","[Aankomst]=800 AND
[Datum_afspraak]=#15/01/09#")

but doesn't seem to work.

Thanks

Dlookup takes string parameters
=DLookUp("[Naam_bedrijf]","[Afspraken]","[Aankomst]=800")

Jean-Paul said:
=DLookUp([Naam_bedrijf];[Afspraken];[Aankomst]=800)

returns a #Name error

I use a Dutch version of Access
I rewrote teh fieldname-tablename 1000 times, nothing changes?

What's wrong?
 
I checked the website you suggested.

They talk about another function: Elookup() and talk about:

Note that ELookup() requires a reference to the DAO library

This is a bit confusing... I don't understand how?
Any help is welcome
Thanks
JP
 
I also tried:

=DLookUp("[Naam_bedrijf]";"[Afspraken]";"[Datum_bezoek]=#me!maandag#")

where me!maandag is a field on my form containing a date
I think the syntax isn't correct
Dlookup takes string parameters
=DLookUp("[Naam_bedrijf]","[Afspraken]","[Aankomst]=800")

Jean-Paul said:
=DLookUp([Naam_bedrijf];[Afspraken];[Aankomst]=800)

returns a #Name error

I use a Dutch version of Access
I rewrote teh fieldname-tablename 1000 times, nothing changes?

What's wrong?
 
There is an alternative ELookup() if you want to code your own, but it is
not referred to on the page about using quotes within quotes.

There is more information about DLookup() here:
http://allenbrowne.com/casu-07.html
That page mentions the alternative as an afterthought, but explains how to
use DLookup().

DLookup() is worth your time to learn it.
 
They are talking about a better ELookUp....

I tried following syntax without succes:

=DLookUp("[Naam_bedrijf]";"[Afspraken]";"[Datum_bezoek]= #" &
Format([Forms!Bedrijven![Maandag];"DD/MM/YYYY") & "#")

What is wrong?
 
OK Guys... it works..

This is my final syntax:

=DLookUp("[Naam_bedrijf]";"[Afspraken]";"[Datum_bezoek]= #" &
Format([Formulieren]![Bedrijven]![knop13].[Caption];"MM/DD/YYYY") & "#
AND [Aankomst]=800")

Another question...

it would be nice to have the background of the field in another colour
when data are found.... is there a way?
Thanks

Jean-Paul said:
They are talking about a better ELookUp....

I tried following syntax without succes:

=DLookUp("[Naam_bedrijf]";"[Afspraken]";"[Datum_bezoek]= #" &
Format([Forms!Bedrijven![Maandag];"DD/MM/YYYY") & "#")

What is wrong?

Allen said:
There is an alternative ELookup() if you want to code your own, but it
is not referred to on the page about using quotes within quotes.

There is more information about DLookup() here:
http://allenbrowne.com/casu-07.html
That page mentions the alternative as an afterthought, but explains
how to use DLookup().

DLookup() is worth your time to learn it.
 
OK Guys... it works..

This is my final syntax:

=DLookUp("[Naam_bedrijf]";"[Afspraken]";"[Datum_bezoek]= #" &
Format([Formulieren]![Bedrijven]![knop13].[Caption];"MM/DD/YYYY") & "#
AND [Aankomst]=800")

Another question...

it would be nice to have the background of the field in another colour
when data are found.... is there a way?
Thanks
Dlookup takes string parameters
=DLookUp("[Naam_bedrijf]","[Afspraken]","[Aankomst]=800")

Jean-Paul said:
=DLookUp([Naam_bedrijf];[Afspraken];[Aankomst]=800)

returns a #Name error

I use a Dutch version of Access
I rewrote teh fieldname-tablename 1000 times, nothing changes?

What's wrong?
 
Back
Top