CrostonScottish
New member
- Local time
- Today, 11:34
- Joined
- Oct 30, 2007
- Messages
- 6
I am having a few problems that i am sure someone can set me right with.
I have a database for students and enrolements on courses. Each Student Record form has a subform based on the SQL below:
The problem i have is i am trying to create a form which opens from a control on my form so i can enrole a student on a new course. The code for my control is:
Ammended from a MS Template as i liked it.
The new form [frmRegistration] is based on the SQL:
I get a form with the currently enroled courses for a student but not sure how i add them. I have changed my [strCourseTitle] to a combo box, but the control source is tbl.CourseList. and trying record source as various things has not worked.
I want to be able to select a course title from tblcourselist and populate all the other related info i.e. course cost, lunch provided memo notes and to create a new booking reference number.
Any ideas?


I have a database for students and enrolements on courses. Each Student Record form has a subform based on the SQL below:
Code:
SELECT tblLINKStudent_Course.lngStudentID, tblLINKStudent_Course.lngCourseID, tblLINKStudent_Course.Courseattended, tblLINKStudent_Course.CoursePaid, tblLINKStudent_Course.CourseComplete, tblLINKStudent_Course.Heardaboutcourse, tblLINKStudent_Course.CourseInfoSent, tblLINKStudent_Course.MemNotes, tblLINKStudent_Course.DateBooked, tblLINKStudent_Course.BookedBy, tblCourselist.lngCourseID, tblCourselist.strCourseTitle, tblCourselist.curCourseCost, tblCourselist.strLunchProvided, tblCourselist.memNotes, tblCourselist.CourseDate, tblLINKStudent_Course.PaidBy, tblLINKStudent_Course.strDietryRequ, tblLINKStudent_Course.BookingReference, tblLINKStudent_Course.ReservedBooked
FROM tblCourselist INNER JOIN tblLINKStudent_Course ON tblCourselist.lngCourseID = tblLINKStudent_Course.lngCourseID
ORDER BY tblLINKStudent_Course.DateBooked DESC;
The problem i have is i am trying to create a form which opens from a control on my form so i can enrole a student on a new course. The code for my control is:
PHP:
Private Sub Add__Booking_Click()
On Error GoTo Err_Register_Click
If IsNull(Me![lngStudentID]) Then
MsgBox "Enter attendee information before registering for an event."
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenForm "frmRegistration"
End If
Exit_Register_Click:
Exit Sub
Err_Register_Click:
MsgBox Err.Description
Resume Exit_Register_Click
End Sub
Ammended from a MS Template as i liked it.
The new form [frmRegistration] is based on the SQL:
Code:
SELECT tblstudentInformation.StrTitle, tblstudentInformation.StrFirstName, tblstudentInformation.StrLastName, tblCourselist.strCourseTitle, tblCourselist.CourseDate, tblCourselist.curCourseCost, tblCourselist.strLunchProvided, tblCourselist.memNotes, tblLINKStudent_Course.Courseattended, tblLINKStudent_Course.CoursePaid, tblLINKStudent_Course.PaidBy, tblLINKStudent_Course.CourseComplete, tblLINKStudent_Course.Heardaboutcourse, tblLINKStudent_Course.CourseInfoSent, tblLINKStudent_Course.MemNotes, tblLINKStudent_Course.DateBooked, tblLINKStudent_Course.BookedBy, tblLINKStudent_Course.strDietryRequ, tblLINKStudent_Course.BookingReference, tblLINKStudent_Course.ReservedBooked, tblLINKStudent_Course.lngCourseID, tblCourselist.lngCourseID
FROM tblstudentInformation INNER JOIN (tblCourselist INNER JOIN tblLINKStudent_Course ON tblCourselist.lngCourseID = tblLINKStudent_Course.lngCourseID) ON tblstudentInformation.lngStudentID = tblLINKStudent_Course.lngStudentID
WHERE (((tblstudentInformation.lngStudentID)=[forms]![frmStudentCourseRecord]![lngStudentID]));
I get a form with the currently enroled courses for a student but not sure how i add them. I have changed my [strCourseTitle] to a combo box, but the control source is tbl.CourseList. and trying record source as various things has not worked.
I want to be able to select a course title from tblcourselist and populate all the other related info i.e. course cost, lunch provided memo notes and to create a new booking reference number.
Any ideas?