>That's fine, but it's just turning the code he (inexplicably) wants to replace with a function that has teh same code.
Oh, I don't think so. How many times do you want to code the IIF statement with all the brackets and quotes vs passing a table name to a function? I think the function route is quicker, cleaner and less susceptible to "fat fingering" the keyboard.<g>
John Harvey
Shelbynet.com
"I'm addicted to placebos. I could quit, but it wouldn't matter." Stephen Wright