280 pts.
 VB6.0_Filter_Find_Code
Hi Expers In VB 6.0 Please Provide code concept with easy examples for Filter and Find (I using DataEnvironment on Desine Form for eg. DataEnvironment.RsEmp.Update etc Thanks Anand

Software/Hardware used:
ASKED: November 21, 2008  6:22 AM
UPDATED: March 22, 2011  5:07 AM

Answer Wiki:
the below code will check the table for the employee number(text1.text) I assumed the first field in the table is empno. DataEnvironment.RsEmp.movefirst a = 1 while DataEnvironment.RsEmp.EOF = false if DataEnvironment.RsEmp.fields(0) = text1.text then msgbox("Empno found") a= 0 exit do else DataEnvironment.RsEmp.movenext end if wend if a = 1 then msgbox("Empno not found") end if Instead coding like this we can use DataEnvironment.RsEmp.find "emp_no= '"+text1.text+"'" text2.text = DataEnvironment.RsEmp.fields(1) text3.text = DataEnvironment.RsEmp.fields(2) You can get the record information as above Filter DataEnvironment.RsEmp.find "dept= '"+text1.text+"'" It will position to the first record of dept = text1.text We can move to the records matching by giving DataEnvironment.RsEmp.movenext
Last Wiki Answer Submitted:  November 21, 2008  8:06 am  by  Try it   90 pts.
All Answer Wiki Contributors:  Try it   90 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _