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 returning, 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 on a simple form where I developed it, and there were not
so many form layers, any suggestions?
The WHERE on the simple form was: WHERE
(((Studies.Ref2)=[Forms]![Group1]![BookName]))

Thanks John
 
Hi,
I beleive you can just use this to refer to your combo:
Forms!Splitter1!BookName
 
Thanks, nothing like overkill on my part, it worked
John
dan artuso said:
Hi,
I beleive you can just use this to refer to your combo:
Forms!Splitter1!BookName

--
HTH
Dan Artuso, MVP


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 returning, 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 on a simple form where I developed it, and there were not
so many form layers, any suggestions?
The WHERE on the simple form was: WHERE
(((Studies.Ref2)=[Forms]![Group1]![BookName]))

Thanks John
 
Back
Top