A quick solution to an annoyance

pafcpilgrim

Keeping it Green
Local time
Today, 14:11
Joined
Apr 14, 2005
Messages
36
Guys,

Why do i keep getting a Null return value even though i know the data exists.

Code:
x = DLookup("Week_Ending", "Tbl_Agent_Production_TC", "Week_Ending = #" & txtWEnding & "# and agent_ID = '" & txtAgentID & "'")

All my other Dlookup's work fine but they don't contain date values so i must be missing something.

Thanks guys.
 
Last edited:
What happens if you use this?

x = DLookup("[Week_Ending]", "[Tbl_Agent_Production_TC]", "[Week_Ending] = #" & Me.txtWEnding & "# And [agent_ID] = """ & Me.txtAgentID & """")

If not that, then this?

x = DLookup("[Week_Ending]", "[Tbl_Agent_Production_TC]", "[Week_Ending] = #" & Me.txtWEnding & "# And [agent_ID] = " & Me.txtAgentID)
 
Still no Joy

Strange i think its the date part of it for some reason, your first option kept returning Null and the second didn't work? Thanks for the samples though.

If you or anyone else can think of anything let me know i will come back to it again later, i'm sure you all know what it's like take a break and the problerm slaps you in the face when you go back it.
 
Try this around the date:

"[Week_Ending] = #" & Format(Me.txtWEnding, "mm/dd/yyyy") & "#
 

Users who are viewing this thread

Back
Top Bottom