DLookup Issue

  • Thread starter Thread starter portesha
  • Start date Start date
P

portesha

Guest
In the form, the field defaults to =date(). We want it to automatically fill two text boxes with our specified week and period from
form Period Calendar Table.We have tried using DLookup in the control source. We have also been unable to get the query to work. Statement: =DLookup("[Period]","Period Calendar Table","[Date]=& Forms![Downtime Entry Form]!Date)

[This message has been edited by portesha (edited 04-25-2002).]
 
The problem may be in the DLookup syntax- I think there's a missing double-quote. Try

=DLookup("[Period]","Period Calendar Table","[Date]=" & Forms![Downtime Entry Form]!Date)

If it still fails you might have to take the form's [Date] field and convert it to a date value using something like

DateValue(Forms![Downtime Entry Form]!Date)

When I'm having problems with a DLookup I bring up the Debug window (Ctrl-G) and modify/run the DLookup until it comes out right.

HTH--
Jim
 
=DLookup("[Period]","Period Calendar Table","[Date]= #" & Forms![Downtime Entry Form]!Date & "#")

If you have a field on your form named "Date" then change it to something else as Date is a reserved word in Access.
 

Users who are viewing this thread

Back
Top Bottom