james3302
07-25-2008, 07:30 AM
Okay I need to add some more where clause to the select statement that is being passed to the MakeCSV module. I have the select statement that is used to create the report with the new criteria. I made strTemp a global variable in hopes that when I assign a string to it in the List109_update that I could still reference that in the function that creates the State csv. But when I get to the function that creates the csv strTemp is blank.
This is the code I have that creates the select statement to make the CSV list of states
strSQL = "SELECT DISTINCT State FROM School "
strSQL = strSQL & " INNER JOIN Scholarship "
strSQL = strSQL & " ON School.SchoolID = Scholarship.SchoolAffiliation "
strSQL = strSQL & " WHERE Scholarship.MinimumGPA <= " & Me.GPA
strSQL = strSQL & " AND Scholarship.MinimumSATACT <= " & Me.SAT
And this is the code that I made that creates the select statement to create the report.
strSQL = "PARAMETERS [FORMS]![SAT].[ACT] Long, [FORMS]![SAT].[GPA] IEEEDouble; SELECT Scholarship.SchoolAffiliation, Scholarship.ScholarshipWeb, Scholarship.AmountOffered, School.Name, School.Street, School.City, School.State, School.ZipCode, School.Phone, School.AdmissionRegDeadline, School.AdmissionEarlyDeadline, School.FinaidRegDeadline, School.FinaidEarlyDeadline, School.CollegeHomePage, School.AdmitEmail, School.FinaidEmail, Scholarship.ScholarshipName, Scholarship.MinimumGPA, Scholarship.MinimumSATACT, Scholarship.minimumACT, Scholarship.MinimumClassRank, Scholarship.ScholarshipDeadline, Scholarship.[Renewable?], Scholarship.ScholarshipWeb, Scholarship.SeparateEssay, Scholarship.SeparateInterview, Scholarship.Major, Scholarship.Audition, Scholarship.Notes, Scholarship.RenewNotes, School.Field15 FROM School INNER JOIN Scholarship ON School.SchoolID = Scholarship.SchoolAffiliation WHERE (((Scholarship.MinimumGPA)<=[FORMS]![SAT].[GPA]) AND ((Scholarship.MinimumACT)<=[FORMS]![SAT].[ACT])) AND "
List109.SetFocus
For Each varItem In Me.ActiveControl.ItemsSelected
strTemp = strTemp & "(State) = " & "'" & Me.ActiveControl.ItemData(varItem) & "'" & " Or "
Next
strSQL = strSQL & "(" & Left(strTemp, Len(strTemp) - 4) & ");"
I need to add the strTemp to the select statement that is used to make the CSV.
This is the code I have that creates the select statement to make the CSV list of states
strSQL = "SELECT DISTINCT State FROM School "
strSQL = strSQL & " INNER JOIN Scholarship "
strSQL = strSQL & " ON School.SchoolID = Scholarship.SchoolAffiliation "
strSQL = strSQL & " WHERE Scholarship.MinimumGPA <= " & Me.GPA
strSQL = strSQL & " AND Scholarship.MinimumSATACT <= " & Me.SAT
And this is the code that I made that creates the select statement to create the report.
strSQL = "PARAMETERS [FORMS]![SAT].[ACT] Long, [FORMS]![SAT].[GPA] IEEEDouble; SELECT Scholarship.SchoolAffiliation, Scholarship.ScholarshipWeb, Scholarship.AmountOffered, School.Name, School.Street, School.City, School.State, School.ZipCode, School.Phone, School.AdmissionRegDeadline, School.AdmissionEarlyDeadline, School.FinaidRegDeadline, School.FinaidEarlyDeadline, School.CollegeHomePage, School.AdmitEmail, School.FinaidEmail, Scholarship.ScholarshipName, Scholarship.MinimumGPA, Scholarship.MinimumSATACT, Scholarship.minimumACT, Scholarship.MinimumClassRank, Scholarship.ScholarshipDeadline, Scholarship.[Renewable?], Scholarship.ScholarshipWeb, Scholarship.SeparateEssay, Scholarship.SeparateInterview, Scholarship.Major, Scholarship.Audition, Scholarship.Notes, Scholarship.RenewNotes, School.Field15 FROM School INNER JOIN Scholarship ON School.SchoolID = Scholarship.SchoolAffiliation WHERE (((Scholarship.MinimumGPA)<=[FORMS]![SAT].[GPA]) AND ((Scholarship.MinimumACT)<=[FORMS]![SAT].[ACT])) AND "
List109.SetFocus
For Each varItem In Me.ActiveControl.ItemsSelected
strTemp = strTemp & "(State) = " & "'" & Me.ActiveControl.ItemData(varItem) & "'" & " Or "
Next
strSQL = strSQL & "(" & Left(strTemp, Len(strTemp) - 4) & ");"
I need to add the strTemp to the select statement that is used to make the CSV.