Unanswered: using <> and >= within a combo box for a condition in a SQL statement
My subject pretty much describes my problem. Within my combo box, I have two conditions which the user can choose from; <>100 and >=0. The problem is that they are being interpreted as strings/text, and I need them to be comparing the data and filtering based on the comparison. Any suggestion on how I can do this?
I got it working. I had to use some code in order for the <> or >= to be interpreted as an expression instead of a string. Here is the code I used:
Private Sub cbxPCT_C_AfterUpdate()
Dim db As DAO.Database
Set db = CurrentDb
db.QueryDefs("qryHolds_With_Filter").SQL = Mid$(db.QueryDefs("qryHolds_With_Filter").SQL, 1, InStr(1, db.QueryDefs("qryHolds_With_Filter").SQL, "WHERE") + 5) & " [PCT_C] " & FORMS![frmSort1]![cbxPCT_C] & ";"