This is so annoying for such a small DB
I have a link table "dbo_qry_Admin_ExternalAPP" which contains basically EmployeeID, FirstName, Surname and other info on that employee.
I have created a a form "Form1" with the Record Source as "dbo_qry_Admin_ExternalApp" and added to the form all the related fields.
I have also created a combobox "SrchName" with a row source of
I have added an 'After Update' event to the combobox so that the form goes to the relevant record where EmployeeID = Srchname, with the following code :-
When I execute the form the combo box works fine but when I select an employee it throws up the error Runtime Error....
It is really frustrating as I have created things like this before with no problems!
I have a link table "dbo_qry_Admin_ExternalAPP" which contains basically EmployeeID, FirstName, Surname and other info on that employee.
I have created a a form "Form1" with the Record Source as "dbo_qry_Admin_ExternalApp" and added to the form all the related fields.
I have also created a combobox "SrchName" with a row source of
Code:
"SELECT dbo_qry_Admin_ExternalApp.EmployeeID, dbo_qry_Admin_ExternalApp.Surname, dbo_qry_Admin_ExternalApp.FirstName FROM dbo_qry_Admin_ExternalApp ORDER BY [Surname]; "
Code:
Private Sub SrchName_AfterUpdate()
Dim strsql As String
strsql = "select * from dbo_qry_Admin_ExternalApp where [EmployeeID] = '" & Me![Srchname] & "'"
Me.Form.RecordSource = strsql
End Sub
When I execute the form the combo box works fine but when I select an employee it throws up the error Runtime Error....
It is really frustrating as I have created things like this before with no problems!