sthrncaliguy
Board Regular
- Joined
- Jul 28, 2009
- Messages
- 213
Alright I have an existing data connection to an ODBC data source. I am curious how I can modify one of the query parameters programatically.
So for instance, my data connection properties which already has a connection setup includes this statement.statement:
SELECT "DataTable"."User Name"
FROM "DataTable" "DataTable"
WHERE ("DataTable"."Office Location"= 'Dallas TX')
And I can refresh this query via VBA with Activeworkbook.RefreshAll or something similiar.
My question is, is there any way to programmatically change the queries parameter on the fly?
So I would like to define a variable called "Location" and then insert that into the Office Location part of the query...
I think if someone could help me get my data connection completely into VBA, instead of on the Data Connections tab, I could probably figure it out myself.
Thanks!
So for instance, my data connection properties which already has a connection setup includes this statement.statement:
SELECT "DataTable"."User Name"
FROM "DataTable" "DataTable"
WHERE ("DataTable"."Office Location"= 'Dallas TX')
And I can refresh this query via VBA with Activeworkbook.RefreshAll or something similiar.
My question is, is there any way to programmatically change the queries parameter on the fly?
So I would like to define a variable called "Location" and then insert that into the Office Location part of the query...
I think if someone could help me get my data connection completely into VBA, instead of on the Data Connections tab, I could probably figure it out myself.
Thanks!