dimwit said:
what should i do to fix this error
If you expect people to debug your code, you must, in general, tell them
more than just the error number. Now, in this case I can go to the
Immediate Window and type in ...
?accesserror(2427)
.... and get the reply:
You entered an expression that has no value.@The expression may
refer to an object that has no value, such as a form, a report, or a
label control.@@1@@1
But in many cases, the error message actually displayed contains more
information than the stock message template returned by the
AccessError() function. And why should your readers have to research
the error, when you know what the error message is? (Here's a hint:
for most error dialogs, you can press Ctrl+C to copy the whole error
message to the clipboard, and then paste it into your newsgroup post
with Ctrl+V.) Also, you need to tell us something more about the
circumstances in which the error occurs. What makes it happen? If it
suddenly started happening after you changed something, what did you
change? If there's code that is running when it happens, post the code.
Asking your question without this information is like saying to your
mechanic, "My car won't go. What's wrong with it?"
Please post back with some information that might help track down the
cause of your problem. There's one possible thing that can cause this
error, besides the obvious suggestion made by the error message itself.
IIRC, you can get this message when you refer to a form's bound controls
in the form's Open event, before the form's recordset has been loaded.