That looks like it may be what I am looking for, though looking at the code I am, a beginner with Access / VBA, thoroughly confused.
Would this be called in the query itself, or on the query after it has been run?
What would the value of qryname (name of query assuming...), keyname, and keyvalue be?