SQL problem

  • Thread starter Thread starter John Thomas
  • Start date Start date
J

John Thomas

I'm having trouble with the following SQL, the form layout goes like this.
Main form name is: Splitter1
Sitting on that is a Tab Control named: Writing
The Tab page name is: TopicStudy
The Combo box name is: BookName

The BookName combo result is what the SQL is not getting, it keeps asking me
for it with a popup, which then works, but not the idea.

Here is the SQL:
SELECT Studies.Group, Studies.Ref1, Studies.Ref2, Studies.Ref3,
Studies.Index, Studies.Document
FROM [Studies.mdb].Studies
WHERE
(((Studies.Ref2)=[Forms]![Splitter1]![Writing]![TopicStudy]![BookName]))
ORDER BY Studies.Ref1;

This worked for me a simple form where I developed it, and there were not so
many layers, any suggestions?
The WHERE on the simple form was: WHERE
(((Studies.Ref2)=[Forms]![Group1]![BookName]))

Thanks John
 
SELECT Studies.Group, Studies.Ref1, Studies.Ref2, Studies.Ref3,
Studies.Index, Studies.Document
FROM [Studies.mdb].Studies
WHERE
(((Studies.Ref2)=[Forms]![Splitter1]![Writing]![TopicStudy]![BookName]))
ORDER BY Studies.Ref1;

The Tab Control is *nothing* other than a way to manage screen real
estate. It need not (and should not) be mentioned in the query
criterion. Just use [Forms]![Splitter1]![BookName].
 
Back
Top