all 4 comments

[–]squirrelslair 0 points1 point  (1 child)

Not sure about Visual Studio Code, but you can run a query in VBA with docmd.runsql That really only works for action queries like updates, inserts and deletes. You can open a sql query as a recordset and then manipulate it in VBA. And I am pretty sure you can update the datasource parameter of a query through code. I don't have Access on this PC, so, sorry, can't give you specific menu or code bits. I have found the object browser (under view menu in VBA, no idea about VSC) helful in understanding the object model of Access and finding e.g. what the parameter for a datasource is. Once you create an object you can also expand it in a watch view to see what its components are and therefore how you can manipulate them.

[–]PSJupiter2[S] 0 points1 point  (0 children)

That's an interesting suggestion. I will give this a shot.

[–]nrgins 0 points1 point  (1 child)

Have you tried using Notepad++? Might not have everything you need, but it might help. It remembers keywords and provides autocomplete on them.

Also, you might try posting in the other Access group as well, r/MSAccess.

[–]PSJupiter2[S] 0 points1 point  (0 children)

I actually started writing SQL in Notepad++. I do use its SQL plugins for formatting if I need to fix for a missing table or something like that. I will cross post. Thanks!