Need to read in a query to lookup a value

S

spacecadet

This is going to be a little confusing. In a query (query1) I need to read
in a field (the complete list) from another query (query2) to lookup a value
and based on that value output a text to query1. It is kinda like using the
excel function "Vlookup". Can anyone help.

Sarah
 
D

Douglas J. Steele

Sounds to me like you need to Join the two tables (or, more accurately, a
table in query 1 to query 2) together.

In the query builder, you can treat other queries exactly the same as
tables, so that it becomes as easy as dragging the appropriate field(s) from
the table onto query2 to join them.
 
S

spacecadet

These two queries are not related. I am going to try to provide an example.

Query1 (50 rows)
Field 1(Screen1): 3
Field 2 (Screen2): 4
Field 3 (Screen3): 1
Field 4 (Group): sa1

Query2 (10 rows)
Field1(Screen1): 3
Field2 (Screen2):4
Field3 (Group): default

This is the condition I would like to set up in a function. If Screen1 in
Query1=Screen1 in Query 2 (must read through the entire field not just that
particular row) & Screen2 in Query1=Screen2 in Query2 then Group in
Query1=Group in Query2.

I hope this helps.

Sarah
 
D

Douglas J. Steele

Sorry, that doesn't make any sense to me.

What do you mean by "must read through the entire field not just that
particular row"?

Aren't you just saying that you want to set Query1.Group to Query2.Group
when Query1.Screen1 = Query2.Screen1 and Query1.Screen2 = Query2.Screen2?
 
Top