try this: Function Encrypt(ByVal strval$, ByVal blndec As Boolean) As String Dim str, str1, str2, str3, str4 As String Dim int1, int2, int3 As Integer str1 = strval$ int1 = Len(str1) int2 = 1 Do While int2 <> (int1 + 1) str2 = Mid(str1, int2, 1) If blndec = True Then int3 = Asc(str2) + 3 'Decrypt Else int3 = Asc(str2) - 3 'Encrypt End If str3 = Chr(int3) str4 = str4 & str3 int2 = int2 + 1 Loop Encrypt = str4 End Function geboy