Ugh! Grammar! I did not realize I was using awhile / a while wrong until I noticed sometimes grammar check changed it and other times, not. Being a “why person,” I investigated.
Whether you spell it awhile or a while, the word(s) mean an unspecified amount of time.
If you need a noun, spell it a while.
It has been a while since I've seen the doctor.
If you need an adverb, spell it awhile.
The doctor told me I’d have to wait awhile.
Wait, it’s not over! What about a prepositional phrase? Use a while after the preposition.
The nurse told me she’d come back in a while with a longer needle. Yikes!
Click grammar party blog for the source and for two easy tricks if you’re unsure if you need a noun (a while) or an adverb (awhile).