i have a search form where can let the user search by firstname(in text box) and department(in drop down)
i use a query like below, if theere have keyword the search based on condition while no keyword select all by default.
in this case, i cant query all the record again after i do the searching. i wan to query all the record again by slect the drop down menu that value is ALL. can u teach me how to qrite the query on it.?thanx.
Code:
if strFirstname<>"" then
SQL="SELECT A.empid, A.firstname,A.lastname,A.statusEmp,B.deptname,C.postname FROM tbl_employee A inner JOIN tbldepartment B ON A.department = B.deptid inner join tbl_position C on A.position=C.postid WHERE A.firstname LIKE '"&strFirstname&"%' AND A.department='"&strdepartment&"'"
else
SQL="SELECT A.empid, A.firstname,A.lastname,A.statusEmp,B.deptname,C.postname FROM tbl_employee A LEFT OUTER JOIN tbldepartment B ON A.department = B.deptid LEFT OUTER JOIN tbl_position C ON A.position=C.postID order by A.department"
end if
plz help...thanx ya.:):)