Hi I'm trying to get SQL to select from a table which the user has chosen from a list box
Heres my code
activity := cmbActivity.Text; //this is where the user selects a table to choose from
qryStudents.SQL.Text := 'SELECT * FROM :activity WHERE CompNo = :iCompNo'; //error here
qryStudents.Parameters.ParamByName('activity').Value:= activity;
qryStudents.Parameters.ParamByName('iCompNo').Value := iCompNo;
qryStudents.Open;
I keep getting a syntax error after FROM in the SQL code (:activity) Any help will be appreciated