Assign Dlookup result to text box issues RTE 2471, HELP

F

FrankBooth

Hello,

I'd appreciate some help on this problem, thanks.

I want to assign the query's return value to a textbox and I'm using
DLookup. However I keep getting RTE 2471 saying that "The object
doesn't contain the automation object [Please Enter Start Date for Avg
Calc]."

Here is my Query:
SELECT [Please Enter Start Date for Avg Calc] AS AvgStart, [Please
Enter End Date for Avg Calc] AS AvgEnd, Avg(Login.StartTime) AS
AvgOfStartTime
FROM Login, Employees
WHERE (((Login.EmployeeID)<>12) AND ((Login.StartDate)>=[Please Enter
Start Date for Avg Calc]) AND ((Login.StartDate)<=[Please Enter End
Date for Avg Calc]));


Here is my code segment:

Private Sub Command13_Click()

Dim xDate As Variant

xDate = DLookup("[StartTime]", "DeptAverage")

End Sub

I tried assigning the WHERE clause of the query to the criteria, but
it still gives the same error. I also tried "[StartTime]<>'"& NULL
&"'" as the criteria and still got the same error.

Would someone please point me to what I might be missing or doing
wrong.

Thank you very much in advance,
--FB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Error 2471 10
Using A Dlookup Function On A Form When A Combo Box is Updated 2
dlookup 2
Using Max or DMax in DLookUp criteria? 1
Assigning a Value 4
DLookup 2
Filter by Date Problem 4
Error message for DLookUp 2

Top