1. Why don't you just use the design view and do it that way.
2. How do you intend to use it via VBA? VBA works as an event--action in the database triggers the code. What action is to trigger this and what exactly do you want as the result? I mean user clicks and button and it writes that code to the query but does nothing else? More context please.