DLookup error

tijotomjoy

Registered User.
Local time
Today, 11:08
Joined
May 14, 2010
Messages
10
Hi,
Im using a dlookup query and it gives a null value everytime.

DLookup("[N_seats]", "Allocation", "[M_Name] = '" & Me.str2 & _
"' AND [A_date] = #" & Combo33.Value & _
"# AND [A_time] = #" & Me.str1 & "#")

A_date: date type
A_time: time type

Combo33.value is a date and str1 is time

Tried so many times and it gives null as output. Is there any way to do this .

Thx in advance..
 
Have you tested your query and it works or it doesn't work??

Then the 2nd issue is if it works, then why doesn't DLookup("[fieldname]", "qryname") work?
 
The trouble i think is with the date and time fields..
It is not checking it..
 
This is out of my league but your quotation marks don't look right

They don't look consistent. Sorry can't be of more assistance.
 
Here is something off the net

VBA Code

The DLookup function can be used in VBA code. For example:
Dim LDate As Date
LDate = DLookup("OrderDate", "Orders", "OrderID = 10248")
In this example, the variable called LDate would now contain the OrderDate value from the Orders table where the OrderID is 10248.
 
This is out of my league but your quotation marks don't look right

They don't look consistent. Sorry can't be of more assistance.


Finally i sorted out.. It was with the quotation marks.
 

Users who are viewing this thread

Back
Top Bottom