sir, try making your query a little dynamic
For eg. for access try this code
"Select * from tb_StudentInfo
where Class=' & Value & '
iif(IsNull('Your value')=false,' and Section=' & value,'') &
and iif(IsNull('Your value')=false,' and Stream=' & value,'')";
in the above example it will search if the
value is null the query becomes this
"Select * from tb_StudentInfo where Class="Value"";