Hi All, This isn't an "I've got a problem" post but more one where I am after some general advice. I recently created (with the help of several helpful members of this forum!) a Sub Procedure in VBA to enable me to automate the Import of some data. The procedure contained a few docmd's and several SQL statements. One of the reasons why I inserted the SQL direct into the procedure and didn't just make a call to the relevant query objects was that I didn't want these task specific queries clogging up the navigation pane, so once the SQL was copied into the procedure (and tested), I deleted the original queries.
However, this has got me thinking! Would it be worthwhile storing all queries as separate procedures or functions in a module. Yes, it can be a bit of a faff getting the syntax right with some of the queries, as the SQL statement doesn't always run "as is" within VBA and you have play around with them. But the upshot is that you can see the inner gubbins of each query at a glance, including all the helpful comments and as already mentioned keep the navigation pane more manageable.
So, am I making a safe assumption or would doing as I suggest create major issues?
Cheers
John
However, this has got me thinking! Would it be worthwhile storing all queries as separate procedures or functions in a module. Yes, it can be a bit of a faff getting the syntax right with some of the queries, as the SQL statement doesn't always run "as is" within VBA and you have play around with them. But the upshot is that you can see the inner gubbins of each query at a glance, including all the helpful comments and as already mentioned keep the navigation pane more manageable.
So, am I making a safe assumption or would doing as I suggest create major issues?
Cheers
John