A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Setting up tables for grades



 
 
Thread Tools Display Modes
  #11  
Old April 23rd, 2010, 07:14 PM posted to microsoft.public.access.forms
Gntlhnds
external usenet poster
 
Posts: 97
Default Setting up tables for grades

I was thinking the problem was my tables. Here's my current structu

tblStudents:
StudentID
Last Name
First Name
Class #

tblCourses:
CourseID
Course

tblCourseGrades:
GradeID (Primary Key)
StudentID (Foreign Key)
CourseID (Foreign Key)
Grade

tblStudents has other fields, but those are the only ones that pertain to
setting up the grades. I know the naming convention for the field names
isn't proper, but I inherited the database and I'm afraid of changing the
field names because it might cause many other things to fail in the database.

Here's how my school operates:
Student shows up and is assigned to a class. The class takes the 13 classes
sequentially. A few weeks later some more students show up, are assigned to
a class, and they start the courses as well, taking them sequentially.
Hopefully that helps clear up what I'm looking for and expecting. I was
thinking I could just create a form that I could select the student from a
combo box, and the subform would list the courses and allow me to input the
student's grade for each class (to be stored in tblCourseGrades). Then I
would create report(s) that would allow me to take those grades and output
them in various formats (one individualized for the student, one for the
class, and then whatever other ones I get tasked to provide). I really do
thank you for helping me out and trying to make me understand how this is
really supposed to work.
  #12  
Old April 23rd, 2010, 08:34 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Setting up tables for grades

On Fri, 23 Apr 2010 11:14:01 -0700, Gntlhnds
wrote:

I was thinking the problem was my tables. Here's my current structu

tblStudents:
StudentID
Last Name
First Name
Class #


What's Class#? I'd remove the blanks from the fieldnames and avoid using # -
it's a date delimiter and can cause problems in fieldnames. If you do keep
them you must ALWAYS use [square brackets] around the fieldnames.


tblCourses:
CourseID
Course

tblCourseGrades:
GradeID (Primary Key)
StudentID (Foreign Key)
CourseID (Foreign Key)
Grade


That appears to be correct. You might want to create a unique twofield index
on StudentID and CourseID to prevent one student from being signed up to the
same course twice.

tblStudents has other fields, but those are the only ones that pertain to
setting up the grades. I know the naming convention for the field names
isn't proper, but I inherited the database and I'm afraid of changing the
field names because it might cause many other things to fail in the database.

Here's how my school operates:
Student shows up and is assigned to a class. The class takes the 13 classes
sequentially. A few weeks later some more students show up, are assigned to
a class, and they start the courses as well, taking them sequentially.
Hopefully that helps clear up what I'm looking for and expecting. I was
thinking I could just create a form that I could select the student from a
combo box, and the subform would list the courses and allow me to input the
student's grade for each class (to be stored in tblCourseGrades). Then I
would create report(s) that would allow me to take those grades and output
them in various formats (one individualized for the student, one for the
class, and then whatever other ones I get tasked to provide). I really do
thank you for helping me out and trying to make me understand how this is
really supposed to work.


You're doing OK. I'd suggest basing a Form on tblStudents; use the combo box
wizard to create an unbound combo on the form to navigate to a particular
student's record (use the option "Use this combo to find a record" in the
wizard).

On the form you would put a Subform based on tblCourseGrades. This subform
would use the StudentID as the master/child link field, and have a combo box
for the CourseID; the combo's rowsource would be the Courses table to let you
pick which courses for that student. The combo will show all the courses. Next
to the combo you'ld have a textbox to enter the grade.
--

John W. Vinson [MVP]
  #13  
Old April 26th, 2010, 03:04 PM posted to microsoft.public.access.forms
Gntlhnds
external usenet poster
 
Posts: 97
Default Setting up tables for grades

Man, this helped so much. This is what I started to try to do, but for some
reason I couldn't get the darn thing to work properly. Your step-by-step
instructions was just what I needed.

About the naming conventions, I unfortunately inherited this database, so
normally I would try to adhere to them, however, I'm afraid that if I change
the names of things, they wouldn't propagate properly. I've already tried
renaming various forms, tables, reports, and queries, and things ended up not
working, and I'd spend hours going back through trying to find places where
the changes didn't propagate.
  #14  
Old April 26th, 2010, 04:28 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Setting up tables for grades

On Mon, 26 Apr 2010 07:04:04 -0700, Gntlhnds
wrote:

Man, this helped so much. This is what I started to try to do, but for some
reason I couldn't get the darn thing to work properly. Your step-by-step
instructions was just what I needed.


Glad to have been of help, and good luck with the database! Don't hesitate to
post back if you still have problems.
--

John W. Vinson [MVP]
  #15  
Old April 27th, 2010, 01:43 PM posted to microsoft.public.access.forms
Gntlhnds
external usenet poster
 
Posts: 97
Default Setting up tables for grades

I am actually having another problem. I'm trying to do a report and in the
footer of StudentID I have an unbound text box to calculate the average grade
for each student. Here is the formula I'm using: =Avg(IsNumeric([Grade])).
It doesn't return the correct grade (-0.825), and it gives the same answer
for each student. Any thoughts? I know this is the Forms thread, so I can
move this question to the Reports if need be.

"John W. Vinson" wrote:

On Mon, 26 Apr 2010 07:04:04 -0700, Gntlhnds
wrote:

Man, this helped so much. This is what I started to try to do, but for some
reason I couldn't get the darn thing to work properly. Your step-by-step
instructions was just what I needed.


Glad to have been of help, and good luck with the database! Don't hesitate to
post back if you still have problems.
--

John W. Vinson [MVP]
.

  #16  
Old April 27th, 2010, 05:13 PM posted to microsoft.public.access.forms
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Setting up tables for grades

On Tue, 27 Apr 2010 05:43:01 -0700, Gntlhnds
wrote:

I am actually having another problem. I'm trying to do a report and in the
footer of StudentID I have an unbound text box to calculate the average grade
for each student. Here is the formula I'm using: =Avg(IsNumeric([Grade])).
It doesn't return the correct grade (-0.825), and it gives the same answer
for each student. Any thoughts? I know this is the Forms thread, so I can
move this question to the Reports if need be.


IsNumeric() is a function which returns True (-1) if the value in [Grade] is
numeric, and False (0) if it isn't. Your expression isn't averaging the
grades; it's averaging the -1's and 0's, not what you want at all!

Try

=Avg(IIF(IsNumeric([Grade]), [Grade], Null)

This will check to see if the field is numeric; if it is it will include it in
the average, if it isn't the NULL will be ignored in the average.

Why the need to check? What does the Grade field contain that isn't numeric,
and why are you trying to average non-numeric values?

--

John W. Vinson [MVP]
  #17  
Old May 20th, 2010, 12:35 PM posted to microsoft.public.access.forms
Gntlhnds
external usenet poster
 
Posts: 97
Default Setting up tables for grades

I know it has been a while since this post was made, but I've finally been
able to devote some time into trying to finish this. I've run into a
problem, though.

In my subform, I have a datasheet with two columns, Course and Grade.
Course is a combo box with CourseID as its control sourse (from
tblCourseGrades), its row source is tblCourses, its bound column is 1, it is
set up with two colums, column widths being 0";1". Grade has its control
sourse as Grade from tblCourseGrades. The problem comes when I try to select
the course to input a grade for it. It won't let me select any course and
tells me in the lower left of the screen "control can't be edited; it's bound
to AutoNumber field "ControlID". If I try to make it an unbound control,
then the courses column appears blank, and when I try to select a course, it
makes that the course for all the records in the datasheet. If I try to use
Course from tblCourses as its control source, I get a message that pops up
when I try to select a course that says "Field cannot be updated", and if I
click "ok" on that it will leave my input as it is, and if I go to another
record and back to that original record, it will allow me to input a grade.
The side effect is that in tblCourseGrades there is a new record, but nothing
in the StudentID field, and tblCourses has a new record that isn't supposed
to be there. What do I need to do to get this seemingly straightforward form
to work properly? Thanks for the help.

"John W. Vinson" wrote:

On Fri, 23 Apr 2010 11:14:01 -0700, Gntlhnds
wrote:

I was thinking the problem was my tables. Here's my current structu

tblStudents:
StudentID
Last Name
First Name
Class #


What's Class#? I'd remove the blanks from the fieldnames and avoid using # -
it's a date delimiter and can cause problems in fieldnames. If you do keep
them you must ALWAYS use [square brackets] around the fieldnames.


tblCourses:
CourseID
Course

tblCourseGrades:
GradeID (Primary Key)
StudentID (Foreign Key)
CourseID (Foreign Key)
Grade


That appears to be correct. You might want to create a unique twofield index
on StudentID and CourseID to prevent one student from being signed up to the
same course twice.

tblStudents has other fields, but those are the only ones that pertain to
setting up the grades. I know the naming convention for the field names
isn't proper, but I inherited the database and I'm afraid of changing the
field names because it might cause many other things to fail in the database.

Here's how my school operates:
Student shows up and is assigned to a class. The class takes the 13 classes
sequentially. A few weeks later some more students show up, are assigned to
a class, and they start the courses as well, taking them sequentially.
Hopefully that helps clear up what I'm looking for and expecting. I was
thinking I could just create a form that I could select the student from a
combo box, and the subform would list the courses and allow me to input the
student's grade for each class (to be stored in tblCourseGrades). Then I
would create report(s) that would allow me to take those grades and output
them in various formats (one individualized for the student, one for the
class, and then whatever other ones I get tasked to provide). I really do
thank you for helping me out and trying to make me understand how this is
really supposed to work.


You're doing OK. I'd suggest basing a Form on tblStudents; use the combo box
wizard to create an unbound combo on the form to navigate to a particular
student's record (use the option "Use this combo to find a record" in the
wizard).

On the form you would put a Subform based on tblCourseGrades. This subform
would use the StudentID as the master/child link field, and have a combo box
for the CourseID; the combo's rowsource would be the Courses table to let you
pick which courses for that student. The combo will show all the courses. Next
to the combo you'ld have a textbox to enter the grade.
--

John W. Vinson [MVP]
.

  #18  
Old May 20th, 2010, 02:05 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Setting up tables for grades

When asking about forms you should always describe the Record Source. Going
back to the table structu

tblStudents:
StudentID
Last Name
etc.

tblCourses:
CourseID
Course

tblCourseGrades:
GradeID (Primary Key)
StudentID (Foreign Key)
CourseID (Foreign Key)
Grade

Click View Relationships. There should be a relationship between the two
StudentID fields, and between the two CourseID fields. The linking fields in
tblCourseGrades need to be the same data type as in tblStudent and tblCourses,
except that if CourseID in tblCouse is autonumber, it needs to be Long
Integer in tblCourseGrades.

Your main form is bound to tblStudent, and your subform to tblCourseGrades.
In design view, click the subform control (the "box" on the main form that
contains the subform), and click View Properties. Be sure the Link Child
and Link Master properties are set to StudentID, as it is the linking field
between the two tables.

On the subform, the Course combo box is bound to StudentID. Remember, the
subform is bound to tblCourseGrades only, so the combo box has CourseID in
tblCourseGrades as its Control Source. The Row Source for the combo box is
tblCourse, with CourseID as the first (hidden) column and Course as the
second (visible) column. The Bound Column for the combo box is 1, and the
Column Count is 2. It sounds like you have the combo box set up correctly,
but I am just reviewing.

tblCourseGrades serves two purposes: It lets you assign students to classes,
and when the class is complete it lets you assign grades. Before the grades
are assigned you can use it to produce a listing of students who are supposed
to be there (so you can take attendance, or whatever). You would do this by
either creating a report based on tblCourse, with a subreport based on
tblCourseGrades; or you could make a query that includes tblCourse and
tblCourseGrades. Make a report based on this query, and group the report
(View Sorting and Grouping) by CourseID.

When you say your subform has a datasheet with two columns, I assume you mean
your subform uses Datasheet as the Default View.

It sounds as if your subform may be bound to something other than
tblCourseGrades.

Gntlhnds wrote:
I know it has been a while since this post was made, but I've finally been
able to devote some time into trying to finish this. I've run into a
problem, though.

In my subform, I have a datasheet with two columns, Course and Grade.
Course is a combo box with CourseID as its control sourse (from
tblCourseGrades), its row source is tblCourses, its bound column is 1, it is
set up with two colums, column widths being 0";1". Grade has its control
sourse as Grade from tblCourseGrades. The problem comes when I try to select
the course to input a grade for it. It won't let me select any course and
tells me in the lower left of the screen "control can't be edited; it's bound
to AutoNumber field "ControlID". If I try to make it an unbound control,
then the courses column appears blank, and when I try to select a course, it
makes that the course for all the records in the datasheet. If I try to use
Course from tblCourses as its control source, I get a message that pops up
when I try to select a course that says "Field cannot be updated", and if I
click "ok" on that it will leave my input as it is, and if I go to another
record and back to that original record, it will allow me to input a grade.
The side effect is that in tblCourseGrades there is a new record, but nothing
in the StudentID field, and tblCourses has a new record that isn't supposed
to be there. What do I need to do to get this seemingly straightforward form
to work properly? Thanks for the help.

I was thinking the problem was my tables. Here's my current structu

[quoted text clipped - 51 lines]
pick which courses for that student. The combo will show all the courses. Next
to the combo you'ld have a textbox to enter the grade.


--
Message posted via http://www.accessmonster.com

  #19  
Old May 20th, 2010, 05:43 PM posted to microsoft.public.access.forms
Gntlhnds
external usenet poster
 
Posts: 97
Default Setting up tables for grades

I don't know how I missed my subform not being bound to tblCourseGrades. I
thought it was, but it had a SELECT statement as its record source. Thanks
for the help. Now it is working the way that it should.

"BruceM via AccessMonster.com" wrote:

When asking about forms you should always describe the Record Source. Going
back to the table structu

tblStudents:
StudentID
Last Name
etc.

tblCourses:
CourseID
Course

tblCourseGrades:
GradeID (Primary Key)
StudentID (Foreign Key)
CourseID (Foreign Key)
Grade

Click View Relationships. There should be a relationship between the two
StudentID fields, and between the two CourseID fields. The linking fields in
tblCourseGrades need to be the same data type as in tblStudent and tblCourses,
except that if CourseID in tblCouse is autonumber, it needs to be Long
Integer in tblCourseGrades.

Your main form is bound to tblStudent, and your subform to tblCourseGrades.
In design view, click the subform control (the "box" on the main form that
contains the subform), and click View Properties. Be sure the Link Child
and Link Master properties are set to StudentID, as it is the linking field
between the two tables.

On the subform, the Course combo box is bound to StudentID. Remember, the
subform is bound to tblCourseGrades only, so the combo box has CourseID in
tblCourseGrades as its Control Source. The Row Source for the combo box is
tblCourse, with CourseID as the first (hidden) column and Course as the
second (visible) column. The Bound Column for the combo box is 1, and the
Column Count is 2. It sounds like you have the combo box set up correctly,
but I am just reviewing.

tblCourseGrades serves two purposes: It lets you assign students to classes,
and when the class is complete it lets you assign grades. Before the grades
are assigned you can use it to produce a listing of students who are supposed
to be there (so you can take attendance, or whatever). You would do this by
either creating a report based on tblCourse, with a subreport based on
tblCourseGrades; or you could make a query that includes tblCourse and
tblCourseGrades. Make a report based on this query, and group the report
(View Sorting and Grouping) by CourseID.

When you say your subform has a datasheet with two columns, I assume you mean
your subform uses Datasheet as the Default View.

It sounds as if your subform may be bound to something other than
tblCourseGrades.

Gntlhnds wrote:
I know it has been a while since this post was made, but I've finally been
able to devote some time into trying to finish this. I've run into a
problem, though.

In my subform, I have a datasheet with two columns, Course and Grade.
Course is a combo box with CourseID as its control sourse (from
tblCourseGrades), its row source is tblCourses, its bound column is 1, it is
set up with two colums, column widths being 0";1". Grade has its control
sourse as Grade from tblCourseGrades. The problem comes when I try to select
the course to input a grade for it. It won't let me select any course and
tells me in the lower left of the screen "control can't be edited; it's bound
to AutoNumber field "ControlID". If I try to make it an unbound control,
then the courses column appears blank, and when I try to select a course, it
makes that the course for all the records in the datasheet. If I try to use
Course from tblCourses as its control source, I get a message that pops up
when I try to select a course that says "Field cannot be updated", and if I
click "ok" on that it will leave my input as it is, and if I go to another
record and back to that original record, it will allow me to input a grade.
The side effect is that in tblCourseGrades there is a new record, but nothing
in the StudentID field, and tblCourses has a new record that isn't supposed
to be there. What do I need to do to get this seemingly straightforward form
to work properly? Thanks for the help.

I was thinking the problem was my tables. Here's my current structu

[quoted text clipped - 51 lines]
pick which courses for that student. The combo will show all the courses. Next
to the combo you'ld have a textbox to enter the grade.


--
Message posted via http://www.accessmonster.com

.

  #20  
Old May 20th, 2010, 07:31 PM posted to microsoft.public.access.forms
BruceM via AccessMonster.com
external usenet poster
 
Posts: 448
Default Setting up tables for grades

I meant to mention that a query based on a table can be used as the Record
Source for a form or report. If tblCourseGrades can be the Record Source, so
can a query based on tblCourseGrades. A query is a SELECT statement with
varying levels of detail, so the correct SELECT statement should work as the
Record Source just as a named query could. You could get a query working as
the Record Source for a form, then open the query in SQL view, copy the text,
and use that instead of the query name as the Record Source. It's all
essentially the same to Access. There may be some performance advantages one
way or the other, but nothing you would be likely to notice in your project.

Gntlhnds wrote:
I don't know how I missed my subform not being bound to tblCourseGrades. I
thought it was, but it had a SELECT statement as its record source. Thanks
for the help. Now it is working the way that it should.

When asking about forms you should always describe the Record Source. Going
back to the table structu

[quoted text clipped - 77 lines]
pick which courses for that student. The combo will show all the courses. Next
to the combo you'ld have a textbox to enter the grade.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/201005/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:04 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.