Hello.
I have a database that I need to modify alot of queries in. Is there any way to use VBA to modify the queries.
Example: I have a saved Access 97 query named qryTest that is
SELECT MYTABLE.MYFIELD1 FROM MYTABLE;
I want it to be:
SELECT MYTABLE.MYFIELD1, MYTABLE.MYFIELD2 FROM MYTABLE;
Same name, permissions, etc..
If I could get the SQL into a variable, I'd be able to modify it like I need to, but I can't fathom how to:
1. Get the actual SQL of query saved in Access 97 into a variable.
2. Output the modified SQL (from the variable) as a query that shows up in Access.
Thanks in advance!!
I have a database that I need to modify alot of queries in. Is there any way to use VBA to modify the queries.
Example: I have a saved Access 97 query named qryTest that is
SELECT MYTABLE.MYFIELD1 FROM MYTABLE;
I want it to be:
SELECT MYTABLE.MYFIELD1, MYTABLE.MYFIELD2 FROM MYTABLE;
Same name, permissions, etc..
If I could get the SQL into a variable, I'd be able to modify it like I need to, but I can't fathom how to:
1. Get the actual SQL of query saved in Access 97 into a variable.
2. Output the modified SQL (from the variable) as a query that shows up in Access.
Thanks in advance!!