G
Guest
Hi,
I have a DB "School.mdb" with three tables:
Students: Student_key, Last, First....
Students Actitities: Student_key, Activity
Activity: Activity_Name
I also have a form with two combo boxes where the user first selects an
Activity from "Activity_Name" and then a student from "Students". When the
student is selected I want to add a record to the "Students Activities"
table. Using the following code:
Private Sub cmbFindStudent_BeforeUpdate(Cancel As Integer)
Dim dbsSchool As Database
Dim rstStudents As Recordset
Set dbsSchool = OpenDatabase("School.mdb")
Set rstStudents = dbsSchool.OpenRecordset("Students Activities",
dbOpenDynaset)
AddName rstStudents, Student_Key, Activity_Name
End Sub
This code came from the NorthWind database. I get a "Type mismatch" error
on the "Set rstStudents..." line. Ingore the line wrap above. Can anyone
tell me why?
thanks,
I have a DB "School.mdb" with three tables:
Students: Student_key, Last, First....
Students Actitities: Student_key, Activity
Activity: Activity_Name
I also have a form with two combo boxes where the user first selects an
Activity from "Activity_Name" and then a student from "Students". When the
student is selected I want to add a record to the "Students Activities"
table. Using the following code:
Private Sub cmbFindStudent_BeforeUpdate(Cancel As Integer)
Dim dbsSchool As Database
Dim rstStudents As Recordset
Set dbsSchool = OpenDatabase("School.mdb")
Set rstStudents = dbsSchool.OpenRecordset("Students Activities",
dbOpenDynaset)
AddName rstStudents, Student_Key, Activity_Name
End Sub
This code came from the NorthWind database. I get a "Type mismatch" error
on the "Set rstStudents..." line. Ingore the line wrap above. Can anyone
tell me why?
thanks,