473,836 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5807
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.

"DataBard00 7" <an*******@devd ex.com> wrote in message
news:3f******** *************@n ews.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
"DataBard00 7" <an*******@devd ex.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.TransferT ext 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******@n ews.microsoft.c om...
"DataBard00 7" <an*******@devd ex.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*********@Se eSig.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*********@See Sig.Invalid (Allen Browne) wrote in
<3f************ **********@free news.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!
Occassionall y an error message is very hard to follow. This line
of code worked fine in the original Access 97:
DoCmd.TransferT ext 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 incomprehensibl e 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.
"DataBard00 7" <an*******@devd ex.com> wrote in message
news:3f******** *************@n ews.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 incomprehensibl e 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

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

Similar topics

37
4701
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 values in (as would be required if I used the hideous, evil, much-abused #define :) ----------- const int constantA = 10; static const int constantB = 20;
9
10890
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. My biggest problem right now is that the error description associated with this error is Application-defined or object-defined error. It has always been my understanding that these error numbers would not be used by Microsoft and were available...
10
5730
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 OwnerZip_AfterUpdate, CBF on frmOwnerEntryFrm. 2109: "There is no field named 'OwnerCity' in the current record." Private Sub OwnerZip_AfterUpdate() On Error GoTo OwnerZip_AfterUpdateErr
9
2302
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 browser. What is the issue? Thanks, Jim Server Error in '/psnRequest' Application. ----------------------------------------------------------------------------
25
17230
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 being uploaded. I'm also using the HtmlInputFile control to do the uploading. My problem is that when the user's file size exceeds 512k, the page immediately redirects to the "The page cannot be displayed" error page which is very confusing. ...
16
2979
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: http://www.mywebsite.org/WebResource.axd?d=5WvLfhnJp5Lc8WhQSD4gdA2&t=632614619884218750 -------------------------------------------------------------------------------- System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed. at...
2
3778
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 implemented using Inherits System.Collections.Specialized.NameObjectCollectionBase and also has the <Serializable()> flag before the class name declaration. In the calling code, I'm successfully serializing the object to an XML file using a...
32
5038
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 not a function" ---------------------------------------------------- I have this in a .js file and in the head section.
3
3744
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 this object”. It is driving me mad as I cant see why it wont let me assign a value. Overview:
0
9668
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10844
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10590
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10254
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7791
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5649
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3113
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.