1 query 2 tables

W

wftech

I want to query 2 tables from 1 form.
the query

SELECT [SignedOutEquipment].[IDNUM], [STUDLIST].[LNAME], [STUDLIST].[FNAME],
[STUDLIST].[PHONE], [STUDLIST].[E-Mail]
FROM STUDLIST INNER JOIN SignedOutEquipment ON
[STUDLIST].[IDNUM]=[SignedOutEquipment].[IDNUM];

Works fine and the query

SELECT [SignedOutEquipment].[BARCODE], [EQUIPINV].[TYPE], [EQUIPINV].[DESCR]
FROM EQUIPINV INNER JOIN SignedOutEquipment ON
[EQUIPINV].[BARCODE]=[SignedOutEquipment].[BARCODE];

Works fine but I cant get the combo

SELECT [SignedOutEquipment].[IDNUM], [SignedOutEquipment].[LNAME],
[SignedOutEquipment].[FNAME],

[SignedOutEquipment].[PHONE], [SignedOutEquipment].[E-MAIL],
[SignedOutEquipment].[BARCODE],

[SignedOutEquipment].[TYPE], [SignedOutEquipment].[DESCR]
FROM STUDLIST INNER JOIN SignedOutEquipment ON
STUDLIST.IDNUM=SignedOutEquipment.IDNUM
AND FROM EQUIPINV INNER JOIN SignedOutEquipment ON
EQUIPINV.BARCODE=SignedOutEquipment.BARCODE;

to work
Help.
 
J

John Spencer

Possibly

SELECT [SignedOutEquipment].[IDNUM]
, [SignedOutEquipment].[LNAME]
, [SignedOutEquipment].[FNAME]
, [SignedOutEquipment].[PHONE]
, [SignedOutEquipment].[E-MAIL]
, [SignedOutEquipment].[BARCODE]
, [SignedOutEquipment].[TYPE]
, [SignedOutEquipment].[DESCR]
FROM (STUDLIST INNER JOIN SignedOutEquipment
ON STUDLIST.IDNUM=SignedOutEquipment.IDNUM)
INNER JOIN EQUIPINV
ON EQUIPINV.BARCODE=SignedOutEquipment.BARCODE;

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
W

wftech

Thanks for trying but still not workingat least this let me save it but it
still isn't doing what I need it to do
What I am looking for is on my form when I put in a student ID the form
auto fills the rest of the student information from the STUDLIST then when I
put in an equipment BARCODE it fills the Equipment info from the EQUIPINV
then this information is saved in the SignedOutEquipment

If I just use the individual queries they both work I input a number and
they autofill but combined neither one will do it.

John Spencer said:
Possibly

SELECT [SignedOutEquipment].[IDNUM]
, [SignedOutEquipment].[LNAME]
, [SignedOutEquipment].[FNAME]
, [SignedOutEquipment].[PHONE]
, [SignedOutEquipment].[E-MAIL]
, [SignedOutEquipment].[BARCODE]
, [SignedOutEquipment].[TYPE]
, [SignedOutEquipment].[DESCR]
FROM (STUDLIST INNER JOIN SignedOutEquipment
ON STUDLIST.IDNUM=SignedOutEquipment.IDNUM)
INNER JOIN EQUIPINV
ON EQUIPINV.BARCODE=SignedOutEquipment.BARCODE;

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
I want to query 2 tables from 1 form.
the query

SELECT [SignedOutEquipment].[IDNUM], [STUDLIST].[LNAME], [STUDLIST].[FNAME],
[STUDLIST].[PHONE], [STUDLIST].[E-Mail]
FROM STUDLIST INNER JOIN SignedOutEquipment ON
[STUDLIST].[IDNUM]=[SignedOutEquipment].[IDNUM];

Works fine and the query

SELECT [SignedOutEquipment].[BARCODE], [EQUIPINV].[TYPE], [EQUIPINV].[DESCR]
FROM EQUIPINV INNER JOIN SignedOutEquipment ON
[EQUIPINV].[BARCODE]=[SignedOutEquipment].[BARCODE];

Works fine but I cant get the combo

SELECT [SignedOutEquipment].[IDNUM], [SignedOutEquipment].[LNAME],
[SignedOutEquipment].[FNAME],

[SignedOutEquipment].[PHONE], [SignedOutEquipment].[E-MAIL],
[SignedOutEquipment].[BARCODE],

[SignedOutEquipment].[TYPE], [SignedOutEquipment].[DESCR]
FROM STUDLIST INNER JOIN SignedOutEquipment ON
STUDLIST.IDNUM=SignedOutEquipment.IDNUM
AND FROM EQUIPINV INNER JOIN SignedOutEquipment ON
EQUIPINV.BARCODE=SignedOutEquipment.BARCODE;

to work
Help.
.
 

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

Top