I have been driving myself insane with this, because I know it's something simple.
I am building a SQL statement that requires the use of a string variable. For the life of me, I cannot get this to work.
I have tried every which way I can think of to get this to work, but it returns 0 records every time.
Can someone point me in the right direction?
Access 2016
I am building a SQL statement that requires the use of a string variable. For the life of me, I cannot get this to work.
Code:
sSQL = "SELECT [lng_RecordID_PK], [txt_QMSCA_CAID], [txt_QMSCA_Source_FK], [dtm_QMSCA_DateInitiated], [txt_QMSCA_Initiator], " & _
"[txt_QMSCA_AssignedTo], [dtm_QMSCA_CADueDate], [dtm_QMSCA_VerificationDueDate], [txt_QMSCA_Status_FK], [txt_QMSCA_Category_FK] " & _
"FROM BE_tbl_QMS_CA_CorrectiveActions " & _
"WHERE ((([txt_QMSCA_Status_FK]) = [B][COLOR=Red]'" & sStatus & "'"[/COLOR][/B] & _
"ORDER BY [lng_RecordID_PK] DESC;"
Can someone point me in the right direction?
Access 2016