As soon as you feel comfortable enough with the dentist to ask. I'm shadowing two right now, and everyday they say "If you need anything let us know, we'll be more than happy to write you a letter."
I've only been going to that office to shadow for a few months, but I've been going to that dentist for treatments and checkups for years!