perhaps the code ends or begins with a space... test the TRIMmed value
If Trim(Nz(Me.VarianceCode, "")) = "I" Then
on the same token, perhaps there is a space or an empty string in
OtherNotes...
If Len(Trim(nz(Me.OtherNotes,""))) = 0 then
also, it would be good to add an error handler to the code
'~~~~~~~~~~~~~~~~~~
'put this at the top of your program, right after the procedure
'declaration (skip a line first for better readability)
'set up Error Handler
On Error GoTo Proc_Err
'-----------
'other statements
'-----------
Proc_Exit:
Exit Sub
Proc_Err:
'NOTE: replace ProcedureName with the name of your procedure
MsgBox Err.Description, , _
"ERROR " & Err.Number _
& " ProcedureName"
Resume Proc_Exit
'if you want to single-step code to find error, CTRL-Break at MsgBox
'then set this to be the next statement
Resume
End Sub
'~~~~~~~~~~~~~~~~~~
and compile...
'~~~~~~~~~ Compile ~~~~~~~~~
Whenever you change code, references, or switch versions, you should
always compile before executing.
from the menu in a VBE (module) window: Debug, Compile
fix any errors on the yellow highlighted lines
keep compiling until nothing happens (this is good!)
~~
if you run code without compiling it, you risk corrupting your database
~~~~~ also be sure to use Option Explicit at the top of each module so
variables that are not declared or are misspelled will be picked up
Warm Regards,
Crystal
remote programming and training
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*

have an awesome day

*