Subform issue

mercredi 18 février 2015

I have a main form that has a combo box (cboCurrentEmployeeName) to select an Employee Name. And then there is a subform within the same form that displays the list of active tasks.



The record source for the subform is a query. The query is as follows. Please note that the tables are joined on employee-id and not the employee name.



SELECT TasksEntries.Project, TasksEntries.Task, TasksEntries.StartDate, TasksEntries.Status FROM TasksEntries INNER JOIN (SELECT EmployeeId FROM Employees WHERE Employees.EmployeeName=Forms!frmMainForm!cboCurren tEmployeeName) AS EmpList ON TasksEntries.EmployeeId=Emplist.EmployeeId WHERE TasksEntries.Status<>'COMPLETE';



The names of the fields in the subform are Project, Task, StartDate, Status and these are present in the subform only and not on the main form



I added an after update event on the cboCurrentEmployeeName which is as follows



Private Sub cboCurrentEmployeeName_AfterUpdate()

Me("StartDate").Form.Requery

End Sub



When I select an employee name from the combo box I get a runtime error 2465: Microsoft office can't find the field StartDate referred to in your expression. I get the same error doesn't matter what field I use.



Your help will be much appreciated.

Subform issue

0 commentaires:

Enregistrer un commentaire

Labels