Dlookup error in criteria date

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can you help me sort out the error in the criteria

=DLookUp("[Week No]","Wages Week No","[Date] =" & [Forms]![Start
Form]![Text171])

Thanks in advance
 
Format the date as mm/dd/yyyy, and delimit with #:

=DLookUp("[Week No]","Wages Week No","[Date] =" &
Format([Forms]![Start Form]![Text171], "\#mm/dd/yyyy\#"))

If Text171 is unbound, set its Format property to Short Date or similar, so
Access knows its a date (and accepts only valid dates).
 
Sorry Allen still does not work comes up with name?
Can you help once more please

Allen Browne said:
Format the date as mm/dd/yyyy, and delimit with #:

=DLookUp("[Week No]","Wages Week No","[Date] =" &
Format([Forms]![Start Form]![Text171], "\#mm/dd/yyyy\#"))

If Text171 is unbound, set its Format property to Short Date or similar, so
Access knows its a date (and accepts only valid dates).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ian 2661 said:
Can you help me sort out the error in the criteria

=DLookUp("[Week No]","Wages Week No","[Date] =" & [Forms]![Start
Form]![Text171])

Thanks in advance
 
What happens instead? Do you get an error message? If so, what is it? If
not, are you getting a value, but just the wrong one?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ian 2661 said:
Sorry Allen still does not work comes up with name?
Can you help once more please

Allen Browne said:
Format the date as mm/dd/yyyy, and delimit with #:

=DLookUp("[Week No]","Wages Week No","[Date] =" &
Format([Forms]![Start Form]![Text171], "\#mm/dd/yyyy\#"))

If Text171 is unbound, set its Format property to Short Date or similar, so
Access knows its a date (and accepts only valid dates).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ian 2661 said:
Can you help me sort out the error in the criteria

=DLookUp("[Week No]","Wages Week No","[Date] =" & [Forms]![Start
Form]![Text171])

Thanks in advance
 
If you are gettting #Name? error, then one or more of the controls you're
calling in the Dlookup doesn't exist. Usually this is caused by
misspellings, extra or missing spaces in the names.

Check the spelling of the names of all the controls called out in your
Dlookup.

In the future...
Avoid using spaces in the names of your controls, and don't use the name
[Date] for your date field (it's a reserved word in Access)

hth
Al Camp

Ian 2661 said:
Sorry Allen still does not work comes up with name?
Can you help once more please

Allen Browne said:
Format the date as mm/dd/yyyy, and delimit with #:

=DLookUp("[Week No]","Wages Week No","[Date] =" &
Format([Forms]![Start Form]![Text171], "\#mm/dd/yyyy\#"))

If Text171 is unbound, set its Format property to Short Date or similar,
so
Access knows its a date (and accepts only valid dates).

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ian 2661 said:
Can you help me sort out the error in the criteria

=DLookUp("[Week No]","Wages Week No","[Date] =" & [Forms]![Start
Form]![Text171])

Thanks in advance
 
Back
Top