DLookup in Query

biggie686

New member
Local time
Today, 08:15
Joined
Feb 4, 2016
Messages
3
Hi everyone

I came into my company (Engineering consultancy) around 2 years ago. They currently use an Access database which records design changes to a large fleet of equipment. To date, the database has mainly been used as an input output with a simple report producing most of the data. I have been asked to produce a new kind of new report which requires data to be taken from 2 tables.

Table 1 is the main data input form which takes a number of details with the fields:
Design Change (DC) Number
DC Title
DC Description
etc etc

Table 2 contains links from the main table to the equipment it is applicable to (linked through an input form on the main form) with the fields as follows

Link number
DC Number
Equipment number
etc

The problem arises in that a single design change may be being made to a number of different tools.

eg.

Design Change Link Number | Design change | Equipment Number
1 | DC1 | Eq1
2 | DC1 | Eq2
3 | DC1 | Eq4
4 | DC1 | Eq6
5 | DC1 | Eq7
6 | DC2 | Eq2
7 | DC3 | Eq4
So on and so forth.

What I am looking to do, is pull the DC Title and DC description into this table from Table 1 using a query which can be used to generate a report.

At the moment all I get is:

Design Change Link Number| Design change| Equipment Number| Design Title
1 | DC1| Eq1 | DCT1
2 | DC1 | Eq2 | DCT2
3 | DC1| Eq4 | DCT3
4 | DC1| Eq5 | DCT4
5 | DC1 | Eq6 | DCT5
6 | DC2 | Eq2 | DCT1
7 | DC3 | Eq4 | DCT2

But it does this for each equipment number. There should be approx 750 records if this is done right but it multiplies quickly and ends up over 150 thousand records.

I have tried using a Dlookup function using the expression I need from table 1 against the DC number found in the query. Unfortunately it just goes blank or shows an error saying that the string is too complex or the syntax isnt right.

Its really starting to get on my nerves. Any ideas for this?

Regards

Liam
 
dlookup is good for 1 field on a form but not this.

use queries rather than dlookup, that's what the join tables is for.
join your tables on the key fields to pull the 'dlookup'.
 
Hi RanMan

The problem is occuring when I attempt to use a query to pull this information out. It is giving me a DCT for each DC number and each equipment number.

Last time I tried to make a query which would do this it was blank.

I really dont know what to do.
 
how about posting an image of or you table relationships and describe in words what you want to do...

for each record in tblX where somefield is equal to something I need to see these fields f2, f2, f3 in tblY where this field in tblX equals that field in tblY
 

Users who are viewing this thread

Back
Top Bottom