Easy question - Expressions in Queries

mtairhead

Registered User.
Local time
Yesterday, 23:47
Joined
Oct 17, 2003
Messages
138
In query criteria, why does this work in Access 97, but not in 2000?

Like "*" & [Forms]![English Words Filters only Words]![Field1] & "*"

I'm pretty sure you can see what I'm trying to do - If the value of Field1 in the form called "English Words Filters only Words" is "whatever", the criteria would be: Like "*whatever*"
 
That should work fine. First thing I'd do is double check the form and control names.
 
Of course you’re right. Leave it to a novice like myself to overlook a simple detail. I wouldn't have even posted the question if I hadn't spent all morning attempting it. It turns out the expression I posted has the correct names, but the one in the query did not... *sigh*

Sorry for the waste of server space webmasters!

Andrew
 
Same issue, but I know my syntax is correct this time

I'm having the same issue I had earlier, but I've checked by syntax over and over again and I don’t think that’s the problem.

My database has a table in it, called “Words And Definitions.” It has two important fields: "Word" and "Meaning"

I have a form called “Words And Definitions.” It has the same two important fields.

I have a query called query1 that should look at the "Word" field from the opened “Words And Definitions” form, and list every single record in which that word appears in the "Meaning" field.

For example, if the word was "Computer", the definition would be "A programmable electronic machine for processing information." If I opened query1, the words "programmable," "electronic," "machine," etc, etc would appear.

I know that the easiest way to do this is to place the following string into the "Meaning" criteria of Query1: "*" & [Forms]![Words And Definitions]![Word] & "*"

That string does not work. Now, if I replace the string with the actual word it does. So, when the form is on the word "Computer", and I change the criteria to "*Computer*" it works. When the form is the word "Computer", and I change the criteria back to "*" & [Forms]![Words And Definitions]![Word] & "*" I get an empty recordset.

What's wrong with me/the database?

I've attached a sample database with the problem, because I am 95% sure that the error lies in something I've not mentioned here.

Thanks for any insight. Feel free to laugh.

Andrew
 

Attachments

Users who are viewing this thread

Back
Top Bottom