Hi there,
I would like to run a select query from a string. basically I want to store the SQL statements in a texbox and click a button to run the code.
Textbox contents =
SELECT CurrentVersion.AreaTeam, CurrentVersion.Version, CurrentVersion.Selected
FROM CurrentVersion
GROUP BY CurrentVersion.AreaTeam, CurrentVersion.Version, CurrentVersion.Selected
HAVING (((CurrentVersion.Selected)=True));
I want the button to execute the code above to create the select query.
I've tried:
Dim strSQL As String
StrSQL = me.txtString
docmd.RunSQL StrSQL
but I get the following error: A RunSQL action requires an argument consiting of an SQL Statement.
is this possible to do for select queries?
I would like to run a select query from a string. basically I want to store the SQL statements in a texbox and click a button to run the code.
Textbox contents =
SELECT CurrentVersion.AreaTeam, CurrentVersion.Version, CurrentVersion.Selected
FROM CurrentVersion
GROUP BY CurrentVersion.AreaTeam, CurrentVersion.Version, CurrentVersion.Selected
HAVING (((CurrentVersion.Selected)=True));
I want the button to execute the code above to create the select query.
I've tried:
Dim strSQL As String
StrSQL = me.txtString
docmd.RunSQL StrSQL
but I get the following error: A RunSQL action requires an argument consiting of an SQL Statement.
is this possible to do for select queries?