You can make your .223 AR convert to 9mm and them back. However, you may find its not so cheap as you might wish for.
Certainly you need separate complete uppers and these run about $500 give or take. You need a good mag well adapter for the 9mm (about $175) and then there is the hammer and buffer. There is debate on just how to do this, either a dedicated 9mm hammer or the use of certain .223 hammers with a ramped bolt on your 9mm. The bugger should probably be changed, another $25 or so.
From that is looks like you need $200 $250 in parts to convert you lower to 9mm. Oh, then the magazines, you will want a few of these and they are $20 to $40. So, if you start with a .223 AR you should plan on spending at least $800 to $900 more to convert back and forth. Also there is the work, changing out the magwell adapter and the buffer and hammer each time you want to switch.
If you shop around you can get a complete new 9mm CMMG or RRA for not much more. Do this and you will have two complete rifles. Its a better deal in my book, but then I like more rifles. I built a RRA 9mm only because I wanted a matching set of rifles with consecutive serial numbers and had the parts to do so. If I had it to do all over I would just buy a 9mm rifle and be done with it.
9mm AR's are the Cat's Ass and sweet to shoot and I have no regrets. I have a 9mm, a .22, and a few 5.56/.223 ARs and love them all. If you can afford it, just go for a complete 9mm factory set-up.