473,396 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error 2448 does not make sense in the context of the problem

Hello Access Gurus:

I use Win98SE and Access97.
I just built a simple Access97 application which holds all contact
information for my personal contacts, such as first name, last name,
address, city, state, etc.
When the user wants to search for a particular record, he does two
things:
1. On the form is a text box on which he enters the text he is searching
for.
2. Then he clicks on an option button to choose which field the search
will be conducted on, e.g., First Name field, Last Name field, etc.
E.g., click the "First Name" option button and type "John" in the text
box to search for records of contacts named John.
Then he clicks a cmdFind button and the code applies a Filter to the
form and finds and displays the record in the underlying table that
contains the text that was entered in the text box.
The trouble is that when I enter an apostrophe in the Search box, I get
the error message "Error 2448. You can't assign a value to this object."
This does not make sense to me because I'm not trying to assign a value
to any object.
I do think I know what is going wrong however. When I put the
apostrophe in the search string, the Filter property does not make sense
because the apostrophe interferes with the proper concatenation of the
different parts of the filter condition (e.g., Me.Filter = SearchField &
" Like '*" & SearchValue & "*'") where SearchValue is the value to be
filtered on, i.e., the value that is entered in the textbox. So if an
apostrophe is entered, the Filter condition is all wrong.

HERE ARE MY TWO QUESTIONS
1. If that's the reason things are going wrong, why do I get error
message "Error 2448. You can't assign a value to this object." It
doesn't seem to make sense based on what the real problem is.
2. Perhaps most importantly:
Is there any resouce on the web that contains Help files that help
developers to understand what causes certain error messages? There's a
ContextID associated with each error message, but where are the help
files that they refer to? They're certainly not part of Access97. If
such a resource existed on the web, it would be of great help to me.

Thanks to anyone who can help me with this.

Patrick


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
10 5730
You don't mention which line gives this error, but I'm guessing it's the
line where you assign the string to the form's Filter. If so, Access is
saying that you cannot assign the string to the filter - not becuase a
filter can't accept a string, but because the attempt to assign this string
failed. The reason is failed is as you observed: the extra apostrophy means
the string is not well-formed for a filter.

As a workaround you might consider embedding double-quotes in the string:
strFilter = "Surname = """ & Me.txtWhat2Find & """"
That will still barf if the user enters a double-quote in the string, but
tha'ts less frequent. If you want to go the next level, you can use the
Replace() function to replace """" with """""" so the double-quote character
is doubled up within the string. Ah: you're using A97, so you would have ot
write your own Replace().

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"DataBard007" <an*******@devdex.com> wrote in message
news:3f*********************@news.frii.net...
Hello Access Gurus:

I use Win98SE and Access97.
I just built a simple Access97 application which holds all contact
information for my personal contacts, such as first name, last name,
address, city, state, etc.
When the user wants to search for a particular record, he does two
things:
1. On the form is a text box on which he enters the text he is searching
for.
2. Then he clicks on an option button to choose which field the search
will be conducted on, e.g., First Name field, Last Name field, etc.
E.g., click the "First Name" option button and type "John" in the text
box to search for records of contacts named John.
Then he clicks a cmdFind button and the code applies a Filter to the
form and finds and displays the record in the underlying table that
contains the text that was entered in the text box.
The trouble is that when I enter an apostrophe in the Search box, I get
the error message "Error 2448. You can't assign a value to this object."
This does not make sense to me because I'm not trying to assign a value
to any object.
I do think I know what is going wrong however. When I put the
apostrophe in the search string, the Filter property does not make sense
because the apostrophe interferes with the proper concatenation of the
different parts of the filter condition (e.g., Me.Filter = SearchField &
" Like '*" & SearchValue & "*'") where SearchValue is the value to be
filtered on, i.e., the value that is entered in the textbox. So if an
apostrophe is entered, the Filter condition is all wrong.

HERE ARE MY TWO QUESTIONS
1. If that's the reason things are going wrong, why do I get error
message "Error 2448. You can't assign a value to this object." It
doesn't seem to make sense based on what the real problem is.
2. Perhaps most importantly:
Is there any resouce on the web that contains Help files that help
developers to understand what causes certain error messages? There's a
ContextID associated with each error message, but where are the help
files that they refer to? They're certainly not part of Access97. If
such a resource existed on the web, it would be of great help to me.

Thanks to anyone who can help me with this.

Patrick

Nov 12 '05 #2
Thanks Allen:

Yes, you were right about the line that caused the error.
Thanks for your suggestion, but I still don't know:
1. Why Access gave this particular error message, which did not give me
any idea as to what the true cause of the problem was?
2. Is there a resource somewhere in the web that has Help files that
help you to determine what causes particular errors? In this case, I was
able to figure out the cause of the problem, but in another case, I may
not be able to without a help file.
Thank You.
Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
"DataBard007" <an*******@devdex.com> wrote...
Yes, you were right about the line that caused the error.
Thanks for your suggestion, but I still don't know:
1. Why Access gave this particular error message, which did not give me
any idea as to what the true cause of the problem was?
Well, the error messages are not always helpful. Often the level at which
they fail is low enough that the piece that failed does not have good
information to put in an error. It is simply life and spending more time
looking at the code ethast caused the error and less time trying to
understand when the error message are obscure will maximize your chances of
success.
2. Is there a resource somewhere in the web that has Help files that
help you to determine what causes particular errors? In this case, I was
able to figure out the cause of the problem, but in another case, I may
not be able to without a help file.


There is really not something like this. Some error messages are helpful,
some are not. And even if the errors were great, good debugging skills are a
lot more important, and useful.
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.

Nov 12 '05 #4
Like michka, I don't think this is a matter of finding a resource about
errors, as it it developing a mindset about how to understand them. A couple
more examples may help.

Open the Immediate window (Ctrl+G) and enter:
? DLookup("zzz", "MyTable")
where MyTable is the name of a table, and "zzz" is a misspelling for a field
name (i.e. the table does not have a field named "zzz"). VBA responds:
Error 2001: You canceled the previous operation"
DLookup() is a high-level function. It passes the request down and discovers
that it failed, but it does not know where it failed. It yields an error
saying that the problem occurred lower down.

Another example. To force Access to save the record in a bound form, we use:
Me.Dirty = False
because that's the only way to specify which form to save (not just the one
that has focus) and receive an error message if the save failed for some
reason (e.g. a validation rule is not met). If Access cannot set the Dirty
property, the actual error message can be (amongst others):
The property cannot be set
At first glance, you might think it is saying the Dirty property is
read-only, especially as the property *was* read-only back in the days of
Access 1 and 2. The reality is that this high-level attempt to set the
property failed at a lower level (e.g. because a required field was
missing), and so VBA quite correctly tells you that setting the property
didn't work this time.

Occassionally an error message is very hard to follow. This line of code
worked fine in the original Access 97:
DoCmd.TransferText acImportDelim,, "MyTable", "C:\MyFile.prn"
However, in Access 2000, it generated the error:
Database is read-only
The problem was that "prn" is not a registered file type for text files, so
TransferText could no longer process it. The error message was miles off!
Fortunately, you don't come across that level of disparity between error and
message very often, and I think MS changed the handling of this error in
A2002.

In the early days of Windows, people used to tease Microsoft because of the
number of error messages. Taglines such as:
Error 2800578##!@ - Out of error messages!
Now, we have come to appreciate the thousands of error messages in our
products, and how - with a bit of experience - they do point you towards a
useful resolution of most problems.

One day I hope to get around to writing an article called, "Error messages
are your friends."

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in
message news:3f******@news.microsoft.com...
"DataBard007" <an*******@devdex.com> wrote...
Yes, you were right about the line that caused the error.
Thanks for your suggestion, but I still don't know:
1. Why Access gave this particular error message, which did not give me
any idea as to what the true cause of the problem was?
Well, the error messages are not always helpful. Often the level at which
they fail is low enough that the piece that failed does not have good
information to put in an error. It is simply life and spending more time
looking at the code ethast caused the error and less time trying to
understand when the error message are obscure will maximize your chances

of success.
2. Is there a resource somewhere in the web that has Help files that
help you to determine what causes particular errors? In this case, I was
able to figure out the cause of the problem, but in another case, I may
not be able to without a help file.
There is really not something like this. Some error messages are helpful,
some are not. And even if the errors were great, good debugging skills are

a lot more important, and useful.

Nov 12 '05 #5
"Allen Browne" <Al*********@SeeSig.Invalid> wrote:
One day I hope to get around to writing an article called, "Error messages
are your friends."


FWIW these kinds of misleading error messages I encounter or non existent such as the
- errors I always try to put on my website for reference purposes.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #6
Al*********@SeeSig.Invalid (Allen Browne) wrote in
<3f**********************@freenews.iinet.net.au> :
Another example. To force Access to save the record in a bound
form, we use:
Me.Dirty = False
because that's the only way to specify which form to save (not
just the one that has focus) and receive an error message if the
save failed for some reason (e.g. a validation rule is not met).
If Access cannot set the Dirty property, the actual error message
can be (amongst others):
The property cannot be set
At first glance, you might think it is saying the Dirty property
is read-only, especially as the property *was* read-only back in
the days of Access 1 and 2. The reality is that this high-level
attempt to set the property failed at a lower level (e.g. because
a required field was missing), and so VBA quite correctly tells
you that setting the property didn't work this time.
I think it was not until A95 or A97 that the .Dirty property
existed, and it was not read-only at any point.

But I could be wrong -- it could have been one of the many things I
didn't know about for a long time. No, the A97 help topic on new
features says that .Dirty was new in A95.

It always struck me as inelegant that you could set the .Dirty
property, but, I am certainly glad that you can!
Occassionally an error message is very hard to follow. This line
of code worked fine in the original Access 97:
DoCmd.TransferText acImportDelim,, "MyTable", "C:\MyFile.prn"
However, in Access 2000, it generated the error:
Database is read-only
The problem was that "prn" is not a registered file type for text
files, so TransferText could no longer process it. The error
message was miles off! Fortunately, you don't come across that
level of disparity between error and message very often, and I
think MS changed the handling of this error in A2002.


Actually, you'd get this error in A97 with SR2 applied.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 12 '05 #7
Tony Toews wrote:

"FWIW these kinds of misleading error messages I encounter or non
existent such as the - errors I always try to put on my website for
reference purposes.
WHAT!?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #8
MichKa Wrote:

"Well, the error messages are not always helpful. Often the level at
which they fail is low enough that the piece that failed does not have
good information to put in an error. It is simply life and spending more
time looking at the code ethast caused the error and less time trying to
understand when the error message are obscure will maximize your chances
of
success."

Thanks for clarifying this for me MichKa.
When I saw the incomprehensible error message, it made me think that
there was some obscure information that had to be researched in order to
be able to solve the problem. But you're saying that it only means the
true cause of the problem was not determined by Access.
As I understand you, the bottom line is, if the error message is useful,
then use it. If it's not, just ignore it and debug the problem
yourself. Is that basically it?

Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #9
Well, not always ignore it, so much as move and try to look for clues based
on the failure itself. Sometimes after you fo that you understand what the
error message was [inadequately] trying to get at. :-)
--
MichKa [MS]
NLS Collation/Locale/Keyboard Development
Globalization Infrastructure and Font Technologies

This posting is provided "AS IS" with
no warranties, and confers no rights.
"DataBard007" <an*******@devdex.com> wrote in message
news:3f*********************@news.frii.net...
MichKa Wrote:

"Well, the error messages are not always helpful. Often the level at
which they fail is low enough that the piece that failed does not have
good information to put in an error. It is simply life and spending more
time looking at the code ethast caused the error and less time trying to
understand when the error message are obscure will maximize your chances
of
success."

Thanks for clarifying this for me MichKa.
When I saw the incomprehensible error message, it made me think that
there was some obscure information that had to be researched in order to
be able to solve the problem. But you're saying that it only means the
true cause of the problem was not determined by Access.
As I understand you, the bottom line is, if the error message is useful,
then use it. If it's not, just ignore it and debug the problem
yourself. Is that basically it?

Patrick

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #10
DataBard007 <an*******@devdex.com> wrote:
When I saw the incomprehensible error message, it made me think that
there was some obscure information that had to be researched in order to
be able to solve the problem. But you're saying that it only means the
true cause of the problem was not determined by Access.
As I understand you, the bottom line is, if the error message is useful,
then use it. If it's not, just ignore it and debug the problem
yourself. Is that basically it?


But to add to Michka's comment. If it doesn't make any sense do a search at
google.com and then groups.google.com. If the error number has a - in the front or
()s then don't put those in the search terms.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: Curt | last post by:
If this is the complete program (ie, the address of the const is never taken, only its value used) is it likely the compiler will allocate ram for constantA or constantB? Or simply substitute the...
9
by: Robert Wing | last post by:
I support an MS Access application in which errors are trapped using the On Error statement. Just recently, the users of this system have experienced run-time error number 3021 on a random basis. ...
10
by: MLH | last post by:
Anybody know why I might be getting error #2109 during the procedure below? It does not occur on 2 desktops, but did on a laptop. The error said: "The following unexpected error occurred in Sub...
9
by: JTrigger | last post by:
When I compile my project using the IDE on a development machine it works just fine. When I compile it on the server using csc.exe, I get the following error when I try to bring it up in the web...
25
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from...
16
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
2
by: Phillip Galey | last post by:
I have an object called Place which contains only string properties and has the <Serializable()> flag before the class name declaration. I also have a collection object called Places, which is...
32
by: paul | last post by:
HI! I keep on getting this error and I have tried different things but I am not sure how to send the expiring date. The error that I am getting in Firefox 1.5 is "Error: expires.toGMTString is...
3
by: philelpko | last post by:
Hi all, I have been banging my head against the wall with this one for a while so I now turn to you all for a pointer. I am currently having trouble with error 2448 “You can't assign a value to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.