How are you opening the query window, by double clicking the nickname in the nicklist?