strange behavior of ? wildcard character

tahir

New member
Local time
Today, 13:54
Joined
Nov 11, 2009
Messages
3
Hi all,

In query grid, in the criteria section, when i type "?xen" to search "Axen" from the "Last Name" field, MS Access gives me an error message as:

" The expression you entered contains an invalid syntax, you may have entered an operand without an operator "

While when I type "*xen" or "A?en", it works fine.

Why does not MS Access takes "?" as the vey first wildcard character in the criteria ?

??

Tahir
 

Attachments

Thanks.

Yes, typing explicitly Like "?xen" works fine.

But, my point is why MS Access automatically inserts Like and double quotes in case of * wildcard

BUT

why does not it takes ? at the beginning and inserts Like and "" automatically?
 
Actually I am working in the field of Human Computer Interaction (HCI) and upto the best of my knowledge this behavior is against the "consistency" rules for designing interfaces/interaction. Thats why i was curious !

:)

Thanks anyway
 
Actually I am working in the field of Human Computer Interaction (HCI) and upto the best of my knowledge this behavior is against the "consistency" rules for designing interfaces/interaction.
<sarcasm mode on> Boy, you must not work with Access much </sarcasm mode off>

Just kidding, but in reality there are a fair amount of things that are not quite consistent in various areas of the program. However, given the number of lines of code and the number of programmers that have worked on the program over the years, things like that can happen. Of course, there could be a rational explanation for the behavior and just because it isn't obvious doesn't mean it doesn't exist. So, that does make it a bit hard to tell which would actually be the case but in the grand scheme of the program it is a very tiny issue. So even if it is a bug, the likelihood that it will get fixed, is probably very low.
 
I can't help thinking there might be some other usage of the ? character as a prefix that has meant the query designer can't safely make the assumption that you are in fact typing a string.

I don't know that for sure, of course (the only other usage I've seen like that is in some BASIC dialects, where ? is a permitted abbreviation of the Print command)
 
Mike, if you think about it when you use the immediate window you can use the ? to substitue the Print command. Also lets say your field contained a string ?DNA representing a abbreviation for "Query Did Not Attend" then Access would have issues with it.

Another example if is using -1 to turn a pos into a neg and vice versa. What you are actually saying is X = X * True if we are to believe the -1 is an abbreviation of True.

David
 

Users who are viewing this thread

Back
Top Bottom