Using VB6
Listbox
checkbox EmpID
Selected 001
unSelected 002
Selected 003
....
....
I want to view the records belonging only to selected employees.
Query
Select * from table where empid = "checkbox selected employees"
Expected Output
EmpID Name Dept.
001 Rajan IT
003 Vijayan Accounts
What code do I need to select multiple employees in the list box?
You can do this by building up a WHERE condition.
As the final SQL needs to be something along these lines:
Or, if your Database supports it:
You just need to go through all your checkboxes and create the string using something like:
Being any more specific than this is difficult without knowing what Database engine and library you're using, the checkbox control structure, or the database schema.