I have a subform and I'm trying to change its recordsource but i keep getting this error :
Run-time error '2467':
The expression you entered refers to an object that is closed or doesn't exist.
Private Sub Combo0_AfterUpd ate()
Dim selectName, sn, cmtxt As String
cmtxt = Combo0.Text
Combo0.SetFocus
selectName = Combo0.Value
sn = "SELECT FirstName,LastN ame FROM TrainersTable WHERE EmployeeID IN (SELECT EmployeeID FROM TrainersAndCour ses WHERE CourseID=(SELEC T CourseID FROM CoursesTable WHERE CourseName=" & "'" & cmtxt & "'" & "))"
Form_SearchForm .RecordSource = sn
MsgBox (Form_SearchFor m.RecordSource)
Child8.SourceOb ject = sn
End Sub
Help please....
Run-time error '2467':
The expression you entered refers to an object that is closed or doesn't exist.
Private Sub Combo0_AfterUpd ate()
Dim selectName, sn, cmtxt As String
cmtxt = Combo0.Text
Combo0.SetFocus
selectName = Combo0.Value
sn = "SELECT FirstName,LastN ame FROM TrainersTable WHERE EmployeeID IN (SELECT EmployeeID FROM TrainersAndCour ses WHERE CourseID=(SELEC T CourseID FROM CoursesTable WHERE CourseName=" & "'" & cmtxt & "'" & "))"
Form_SearchForm .RecordSource = sn
MsgBox (Form_SearchFor m.RecordSource)
Child8.SourceOb ject = sn
End Sub
Help please....
Comment