form filtering

  • Thread starter Thread starter Betsy
  • Start date Start date
B

Betsy

I have a form that filters students based on the school
that they attend. I need to accommodate a second school
as some students attend a second school half days. I do
not want to list the student twice in the table because I
can't track all their activities that way. I have added
a check box to the student table if they attend the
second school they can check it.
Student table looks like this:
StudentID AutoNumber
StudentFirstName Text
StudentLastName Text
SchoolID linked to School Table
SCT Yes/No

I built a query to filter the form based on the School.
When you select a school all the students in that school
are available in the Student Combo Box. The query uses
the following expression under SchoolID
[Forms]![frmEventDup]![frmLinkStudentDup]![SchoolID]

How do I incorporate the check box to indicate that they
attend this other school???
 
Betsy, If I'm understanding you correctly you simply want the SCT field to
show in your combobox. If so, in the query you are already using for the
combo box just add the SCT field to the query. Now open the form and
double-click the combobox in question. Click the all tab and set the column
count to the number of columns you want to show when you click in the
combobox. Then for column widths set a width for each column. Then I
normally set the List Width = to the sum of the column widths. So for
example if I have a 3 column combo box I would set the following:

Column Count = 3
Column Widths = 1";1";1"
Bound Column = 1
List Rows = 10
List Width = 3"

If you want to "not" show the first column you can set its width to zero(0")
like so
Column Widths = 0";1";1"

Hope I understood your request and this helps!
 
Thank you for your answer. I did not explain myself
well. I actually need to be able to let staff search by
this second school.

When they select the school from the school combo box the
Students combo shows all the students who belong to that
school. Some staff need to bring up a list of those
students who attend the second school How do I do that
based on the code I use in the first message? Or I could
change the code. It's done in a query. If I used code
what would it look like?
-----Original Message-----
Betsy, If I'm understanding you correctly you simply want the SCT field to
show in your combobox. If so, in the query you are already using for the
combo box just add the SCT field to the query. Now open the form and
double-click the combobox in question. Click the all tab and set the column
count to the number of columns you want to show when you click in the
combobox. Then for column widths set a width for each column. Then I
normally set the List Width = to the sum of the column widths. So for
example if I have a 3 column combo box I would set the following:

Column Count = 3
Column Widths = 1";1";1"
Bound Column = 1
List Rows = 10
List Width = 3"

If you want to "not" show the first column you can set its width to zero(0")
like so
Column Widths = 0";1";1"

Hope I understood your request and this helps!
--
Reggie

----------
I have a form that filters students based on the school
that they attend. I need to accommodate a second school
as some students attend a second school half days. I do
not want to list the student twice in the table because I
can't track all their activities that way. I have added
a check box to the student table if they attend the
second school they can check it.
Student table looks like this:
StudentID AutoNumber
StudentFirstName Text
StudentLastName Text
SchoolID linked to School Table
SCT Yes/No

I built a query to filter the form based on the School.
When you select a school all the students in that school
are available in the Student Combo Box. The query uses
the following expression under SchoolID
[Forms]![frmEventDup]![frmLinkStudentDup]![SchoolID]

How do I incorporate the check box to indicate that they
attend this other school???


.
 
I've tried this code, but I keep getting syntax errors.
Don't know what is wrong with it.

Private Sub StudentID_GotFocus()
Select Case SchoolID
Case SchoolID <> 44
SELECT (Student.StudentID,
Student.StudentLastName, Student.StudentFirstName)
FROM Student
WHERE (((Student.SchoolID) = [Forms]!
[frmEventMain]![frmLinkStudent]![SchoolID]))
ORDER BY Student.StudentLastName,
Student.StudentFirstName;
Case SchoolID = 44
SELECT Student.StudentID,
Student.StudentLastName, Student.StudentFirstName,
Student.SchoolID
FROM Student
WHERE (((Student.[SCT BOCES]) = yes))
ORDER BY Student.StudentLastName,
Student.StudentFirstName;
End Select
End If


End Sub


-----Original Message-----
Thank you for your answer. I did not explain myself
well. I actually need to be able to let staff search by
this second school.

When they select the school from the school combo box the
Students combo shows all the students who belong to that
school. Some staff need to bring up a list of those
students who attend the second school How do I do that
based on the code I use in the first message? Or I could
change the code. It's done in a query. If I used code
what would it look like?
-----Original Message-----
Betsy, If I'm understanding you correctly you simply want the SCT field to
show in your combobox. If so, in the query you are already using for the
combo box just add the SCT field to the query. Now
open
the form and
double-click the combobox in question. Click the all
tab
and set the column
count to the number of columns you want to show when
you
click in the
combobox. Then for column widths set a width for each column. Then I
normally set the List Width = to the sum of the column widths. So for
example if I have a 3 column combo box I would set the following:

Column Count = 3
Column Widths = 1";1";1"
Bound Column = 1
List Rows = 10
List Width = 3"

If you want to "not" show the first column you can set its width to zero(0")
like so
Column Widths = 0";1";1"

Hope I understood your request and this helps!
I
do
not want to list the student twice in the table because I
can't track all their activities that way. I have added
a check box to the student table if they attend the
second school they can check it.
Student table looks like this:
StudentID AutoNumber
StudentFirstName Text
StudentLastName Text
SchoolID linked to School Table
SCT Yes/No

I built a query to filter the form based on the School.
When you select a school all the students in that school
are available in the Student Combo Box. The query uses
the following expression under SchoolID
[Forms]![frmEventDup]![frmLinkStudentDup]![SchoolID]

How do I incorporate the check box to indicate that they
attend this other school???


.
.
 
Back
Top