Is it possible to build an IF statement with a variable operator?
I have a requirement to allow the end user to select a field No. within a Datagridview, then select an operator from a Combobox and finally select a value. The field No. and value are no problem I just use the following:
If DataGridView1.CurrentRow.Cells(FieldNo).Value = FilterValueBox.Text Then
My problem is I want the user to select an operator i.e. =, <>, <, >, <=, >=
Apart from testing the value in the operator combobox and having a separate If statement for each option is there a way of creating a single IF statement.
I have a requirement to allow the end user to select a field No. within a Datagridview, then select an operator from a Combobox and finally select a value. The field No. and value are no problem I just use the following:
If DataGridView1.CurrentRow.Cells(FieldNo).Value = FilterValueBox.Text Then
My problem is I want the user to select an operator i.e. =, <>, <, >, <=, >=
Apart from testing the value in the operator combobox and having a separate If statement for each option is there a way of creating a single IF statement.