View Single Post
  #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

.