Is it possible to do something along the lines of the
Mid(stringToExamin, [start_position>, [number_of_characters>) = [Condition_character>
expression in a strSQL statement?
Currently I have along the lines of:
strSQL = "SELECT tblTable.* FROM tblTable;"
'Then having opened the connection and running through have:
If Mid(rs("permissions"), lngAccessLevel, 1) = 1 Then
'Display record
End If
'movenext, loop, etc.
Where tblTable.permissions is a text string (eg, 1101) and lngAccessLevel is the user's status (eg, 1, 2, 3 or 4).
So a level 3 user wont see that record, but others will.
Is it possible to apply the same conditions in the strSQL statement instead, to filter out records the user can't see, rather than bringing them back only to ignore them?
Something like (in concept):
strSQL = "SELECT tblTable.* FROM tblTable WHERE Mid(tblTable.permissions, lngAccessLevel, 1) = 1;"
(which doesn't work - doesn't bring back and errors but doesn't show any records either, even though it "should")
Ta