I am trying to sort a database connection depending on what the user selects in a combo box filled from the list property. The syntax I am using is incorrect as it does not see the value the variable is holding but only the variable.
My code is as follows:
spChoice = cboSort.text 'user selection from drop down
spSQL = SELECT * FROM Patient ORDER BY spChoice ASC
Set rsPatient = cnPatient.Execute (spSql,,adCmdText)
In my set statement the spSql remains the exact statement assigned not the selection from the user. What am I missing?
Any help is greatly appreciated.
My code is as follows:
spChoice = cboSort.text 'user selection from drop down
spSQL = SELECT * FROM Patient ORDER BY spChoice ASC
Set rsPatient = cnPatient.Execute (spSql,,adCmdText)
In my set statement the spSql remains the exact statement assigned not the selection from the user. What am I missing?
Any help is greatly appreciated.