It was definitely a string vs integer error like both of you noted. Ifound the solution (with lots of help) with the following code:CLng(Left(iGroupNum, Len(CStr(iGroupNum))) - 2)