Open a Form base on Sql String in a combos rowsource.

W

Winters

I think I originally placed the following in the wrong forum.
Hopefully this is where it should've been...

I have Two Combos The first feeds the second. I am able to use the following
Sql string to open a form on the FIRST combo but can't figure out how to do
it for the second.
Combo1:
SELECT tblSchool.SchoolID, tblSchool.SchoolName FROM tblSchool UNION SELECT
0, "|**Add a NEW School**|" AS Expr1 FROM tblSchool ORDER BY
tblSchool.SchoolName;
Then in the AfterUpdate I open a form if Combo1 = 0 and set the rowsource
for the secodn Combo.

With the second combo being more complex I can't seem to get the "Union
Select 0..." stuff to work. Following is what the rowsource is set to for
Combo2.
I've tried several variations of placing the "UNION Select 0 ..." all to no
avail. Myabe it can't be done? I
don't know. Can someone please advise. Many Thanks!

Combo2:
"SELECT tblSchoolStaff.StaffID, tblSchoolStaff!FirstName & ' ' &
tblSchoolStaff!LastName AS Expr1 FROM tblSchoolStaff WHERE
(((tblSchoolStaff.SchoolID)=" &
Forms![frmTCCurriculum]![fsubConcEdI].Form![fsubTC_SchoolAndStaff].Form![Combo1]
& ")) ORDER BY tblSchoolStaff!LastName & ' ' & tblSchoolStaff!FirstName;"
 

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