Table1 Table2
Query1
Field-A Field-B Field-B Field-C Field-A
Field-B Field-C
1 a a One 1
a One
2 b b Two 2
b Two
3 c c Three 3
c Three
4 b d .... 4
b Two
5 a e .... 5
a One
I need to create that query... Please... help
I need help on this one... I have two tables and a Query. Example:
Table1 Table2 Query
"rowiga" wrote:
I don't understand your question. How does this array apply to DLookup?
What are you trying to accomplish?
"Victor Torres" wrote:
Sorry this is better...
I need help on this one... I have two tables and a Query. Example:
Table1 Table2 Query
Field-A Field-B Field-B Field-C Field-A Field-B Field-D
=DLookup("[Field]","Location","Criteria")
FIELD is the field that you want to get information from.
LOCATION is the Table name or Query name that the field is in.
CRITERIA specifies the rules that you use to get the desired result.
I have a Contact database to log phone calls. I have a table called
tblContacts. This table stores all information about a contact. I also have a
form that I use to document the calls. On the form I have ContactName and
ContactID. ContactID is the primary key for tblContacts. When a user slects a
contact from a combo box I use DLookup to locate the contact's phone number.
It's done by:
=DLookUp("[ContactPhone]","tblContacts","[ContactID]=[Forms]![MyFormName]![ContactID]")
In other words...show me the phone number from tblContacts where the
ContactID field in the table is equal to the ContactID field on my form.
Just use the query builder. If you have 1 (in your case), or have 10, or
even 15 fields that are lookups to other tables, then don't bother using
dlookup, but just the query builder. The query builder is fun, you get to
use the mouse, and no code, or funny expression need be entered here. You
can do this all via the mouse....
Just drop in table1, and then drop in the other tables for the lookup
values. In your case, you only got one other table,...but you can/could drop
in 5 other tables that you need lookup values from (if you had that many
tables)..
Just use the mose to draw a join line from the main table (tale1) to the
child able. You should also make this join a "left" join (double click on
the join line, and select the option that says anything from the table on
the left side...and possible entries on the right side).
Now, just drop in fields from any of he tables...and they will display in
the query...
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOO...@msn.com
http://www.members.shaw.ca/AlbertKallal