i have one field "Type" in ADO recordset (reading text field from Access table and showing it in datagrid)
this field can have values like (xxx is extension/number):
ASE xxx
ASD xxx
ASV xxx
TSE xxx
TSD xxx
TSV xxx
i have five checkboxes on form (chAS, chTS, chE, chV, chD) - as default all have value 1 (checked) and all data are displayed.
i want to set filter for ado recordset, so an user should be able to select dislayed record in datagrid by checking/unchecking these check boxes.
my code is now like:
If chTS.Value = 0 Then
rs3.Filter = "Type='AS*'"
DataGrid2.Refresh
End If
If chAS.Value = 0 Then
rs3.Filter = "Type='TS*'"
DataGrid2.Refresh
End If
If chE.Value = 0 Then
rs3.Filter = "Type='ASD*' OR Type='ASV*'"
DataGrid2.Refresh
End If
If chD.Value = 0 Then
rs3.Filter = "Type='ASE*' OR Type='ASV*'"
DataGrid2.Refresh
End If
If chV.Value = 0 Then
rs3.Filter = "Type='ASD*' OR Type='ASE*'"
DataGrid2.Refresh
End If
but only first two are working.
what would be the best way to do it properly? any ideas, please?
this field can have values like (xxx is extension/number):
ASE xxx
ASD xxx
ASV xxx
TSE xxx
TSD xxx
TSV xxx
i have five checkboxes on form (chAS, chTS, chE, chV, chD) - as default all have value 1 (checked) and all data are displayed.
i want to set filter for ado recordset, so an user should be able to select dislayed record in datagrid by checking/unchecking these check boxes.
my code is now like:
If chTS.Value = 0 Then
rs3.Filter = "Type='AS*'"
DataGrid2.Refresh
End If
If chAS.Value = 0 Then
rs3.Filter = "Type='TS*'"
DataGrid2.Refresh
End If
If chE.Value = 0 Then
rs3.Filter = "Type='ASD*' OR Type='ASV*'"
DataGrid2.Refresh
End If
If chD.Value = 0 Then
rs3.Filter = "Type='ASE*' OR Type='ASV*'"
DataGrid2.Refresh
End If
If chV.Value = 0 Then
rs3.Filter = "Type='ASD*' OR Type='ASE*'"
DataGrid2.Refresh
End If
but only first two are working.
what would be the best way to do it properly? any ideas, please?