Hi all,
I have a ListBox that uses two different queries based on a text box value. This is for security purposes. One query shows all records and the other query hides some records when there is a certain flag.
When the user accesses the form the text box is given a value and the appropriate query populates the ListBox based on the access level in the textbox.
What I want to accomplish is use a SELECT statement to use a string variable within a string for those two queries.
e.g.
Dim strOrd as String
Dim strQuery as String
strSql = "SELECT * FROM strQuery ORDER BY "
Then use the full string with the appropriate query further down in the code
strSql = strSql & "ID " & strOrd
Is this possible? If yes what would be the correct syntax?
Thank you in advance
I have a ListBox that uses two different queries based on a text box value. This is for security purposes. One query shows all records and the other query hides some records when there is a certain flag.
When the user accesses the form the text box is given a value and the appropriate query populates the ListBox based on the access level in the textbox.
What I want to accomplish is use a SELECT statement to use a string variable within a string for those two queries.
e.g.
Dim strOrd as String
Dim strQuery as String
strSql = "SELECT * FROM strQuery ORDER BY "
Then use the full string with the appropriate query further down in the code
strSql = strSql & "ID " & strOrd
Is this possible? If yes what would be the correct syntax?
Thank you in advance
Last edited: