Using selection from textbox to limit query.

Wegets7

Registered User.
Local time
, 17:19
Joined
Oct 18, 2004
Messages
40
I am trying to use the title selected in one text box to limit the query that populates another text box.

This is my simplistic attempt at it:

Code:
SELECT COPY.CopyKey, COPY.CopyId, TITLE.Title, TITLE.Edition
FROM COPY INNER JOIN TITLE ON COPY,FK_ISBN=TITLE.PK_ISBN
WHERE(((COIP.CopyKey)Not In 
(SELECT FK_CopyKey Form ISSUES_to_STUDENT WHERE DateIn Is NULL)))
AND TITLE.Title=[forms]![3__ISSUES_to_Student]![TitleList] 
'The last is the simplistic part.

Can anyone point me in the right direction.
Thanks in advance.
Rich
 
"SELECT COPY.CopyKey, COPY.CopyId, TITLE.Title, TITLE.Edition
FROM COPY INNER JOIN TITLE ON COPY,FK_ISBN=TITLE.PK_ISBN
WHERE(((COIP.CopyKey)Not In
(SELECT FK_CopyKey Form ISSUES_to_STUDENT WHERE DateIn Is NULL)))
AND TITLE.Title=" & [forms]![3__ISSUES_to_Student]![TitleList]

The textbox is variable and must be referenced, not hardcoded. If the textbox contents is number, enclose it in quqtes, if a date, enclose it with #.
 
You also have at least two typos in the SQL.
 
Code:
SELECT COPY.CopyKey, COPY.CopyId, TITLE.Title, TITLE.Edition
FROM COPY INNER JOIN TITLE ON COPY,FK_ISBN=TITLE.PK_ISBN
WHERE(((COPY.CopyKey)Not In 
(SELECT FK_CopyKey From ISSUES_to_STUDENT WHERE DateIn Is NULL)))
AND TITLE.Title=[forms]![3__ISSUES_to_Student]![TitleList]
Ok, here is a typo free version.

>The textbox is variable and must be referenced, not hardcoded. If the textbox
>contents is number, enclose it in quqtes, if a date, enclose it with #.

What if it is text such as a book title?
 

Users who are viewing this thread

Back
Top Bottom