Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run time error 3464

Status
Not open for further replies.

mikeba1

Programmer
Jan 2, 2005
235
GB
I'm going crazy.

The following gives me the error

Dim bh As Date
bh = DLookup("[bhdate]", "bankholidays", "[bhdate] = '" & [NextDateFrom] & "' ")


info

table bankholidays

bhdate Date/Time (key)
bhname Text


[NextDateFrom] is a date field on the current form
 
Did you try:
[tt]
bh = DLookup("[bhdate]", "bankholidays", "[bhdate] = #" & [NextDateFrom] & "#")
[/tt]

Have fun.

---- Andy

A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
 
Thanks Andy

It no longer gives me the error BUT doesn't return anything in bh, even if a record exists for that date
 
Try use the immediate/debug window to test some expressions with hard-coded dates. Or you could set a break point in your code to check the value of [NextDateFrom].

Duane
Hook'D on Access
MS Access MVP
 
I use msgbox to look at nextdatefrom, and it is a valid date
 
Thanks guys
Changed format and it worked
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top