Error message

G

Guest

i am checking to see if an entry has been made before unloading my form it
all seems to work ok but after my prompt msg access throws up an error msg

"The Microsoft Jet database engine could not find the object ". Make sure
the object exists and that you spell its name and the path name correctly."

My database is in 2003 but after doing a bit of digging it seems this error
msg refers to Access 97 i can't seem to find any reference to Access 2003

so my code is this is in the unload section

If Len(Me.ComboName) = 0 then
MsgBox "Must enter value in ..."
cancel = true ' wont move to the next record
me.ComboName.SetFocus
End If

if there is data in the required field there is no problem

Thanks in advance
Arnie
 
M

Michel Walsh

Have you tried:


if Len( vbNullString & Me.ComboName) = 0 Then
...
end if



Because if the control VALUE return a NULL, the

if (null) then

else

end if

will see its else part being executed (because the value NULL is not the
value TRUE, neither it is the value FALSE, by the way). The Concatenation
with the vbNullString will transform the null value into a string of no
character, and thus, the true part of the if statement will be evaluated.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top