Thread: DLookUp Format
View Single Post
  #2  
Old April 28th, 2010, 04:32 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default DLookUp Format

"Doesn't work" is too vague to be of any real use. I can say that since Tbl
Vol Opportunities has spaces in the table name it needs to be enclosed in
square brackets as you have done for the field name. Also, if you are
looking for an equivalent [Event ID] field you need to use [Event ID], not
[Employee ID] in the expression.

It is unclear what you mean by the "DLookup attached to [Actual Start Time]".

I will make the following assumptions: The expression (with the corrections
suggested above) is used as the Control Source of a text box on a form;
EventID is a number field; and EventID is both a field in [Tbl Vol
Opportunities] and a field in the form's Record Source. Given those
assumptions, the expression will look up [Start Time] in the first record in
[Tbl Vol Opportunities] in which EventID matches the EventID field in the
form's Record Source.

You did not describe anything about [Tbl Vol Opportunities], but you provided
some information about [Tbl Opportunities]. Are they the same?

Flopbot wrote:
I know the criteria statement on my DLookUp is wrong, but I don’t know the
correct format. I have the following in Access 03.

“SubFrm Opportunities” taken from “Tbl Opportunities”. Contains field
[Start Time].
“SubSubFrm Actual” taken from “Tbl Actual”. Contains field [Actual Start
Time].
Both tables have the field [Event ID].

The DLookup attached to [Actual Start Time] in “SubSubFrm Actual” should
return the time listed in [Start Time] in “Tbl Opportunities” when the [Event
ID] is identical. I’ve tried the following, but it doesn’t work. Any ideas?

=DLookUp("[Start Time]","Tbl Vol Opportunities", “[EmployeeID] = ” &
[Employee ID])


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201004/1