I have a search form, well actually two but they both work the same so.
The form frmEmployeeSearch has two text fields txtEmployeeID: and txtContactNo: as well as two command buttons cmdSearch and cmdEdit.
Entering either an EmployeeID and/or ContactNo and clicking search runs a query EmployeeSearchQuery and opens a report EmployeeSearchReport with details from the search.
Entering an EmployeeID and clicking Edit opens another form, frmEmployeeForm to the record related to the EmployeeID.
The problem I have is with the report.
Searching ID "1" results in employee 1, 10, 11 and so on. How can I refine the search to just "1"?
Here is the query's SQL
Thanks in advance,
Mark.
The form frmEmployeeSearch has two text fields txtEmployeeID: and txtContactNo: as well as two command buttons cmdSearch and cmdEdit.
Entering either an EmployeeID and/or ContactNo and clicking search runs a query EmployeeSearchQuery and opens a report EmployeeSearchReport with details from the search.
Entering an EmployeeID and clicking Edit opens another form, frmEmployeeForm to the record related to the EmployeeID.
The problem I have is with the report.
Searching ID "1" results in employee 1, 10, 11 and so on. How can I refine the search to just "1"?
Here is the query's SQL
Code:
SELECT tblEmployee.EmployeeID, tblEmployee.Surname, tblEmployee.FirstName, tblEmployee.Gender, tblEmployee.DateofBirth, tblEmployee.Position, tblEmployee.Title, tblEmployee.DateHired, tblEmployeeDetails.ContactNumber, tblEmployeeDetails.Email, tblEmployeeDetails.Address, tblEmployeeDetails.Town, tblEmployeeDetails.PostalCode
FROM tblEmployee INNER JOIN tblEmployeeDetails ON tblEmployee.EmployeeID = tblEmployeeDetails.EmployeeID
WHERE (((tblEmployee.EmployeeID) Like "*" & [Forms]![frmEmployeeSearch]![txtEmployeeID] & "*") AND ((tblEmployeeDetails.ContactNumber) Like "*" & [Forms]![frmEmployeeSearch]![txtContactNo] & "*"));
Thanks in advance,
Mark.