query by form

dcobau

Registered User.
Local time
Tomorrow, 06:21
Joined
Mar 1, 2004
Messages
124
Hi all,

I have used queries by form before but this is a variation that I have never used before and I can't find a solution quickly.

I have a form (frmFilterPublications) which I use to enter a value (txtTitle) and filter data contained in another form (frmPublications).

Normally I would enter criteria in the query grid to match records with values = to Forms!frmFilterPublications!txtTitle. Works great exept in this case I don't want to spend half an hour to enter the entire title of a publication. I wouldn't probably remember the full title anyway. So I have to enter part of it. Again, it is easy to set a query with a perimeter such as Like [Enter Name] & "*". Would work ok exept there might be more then one title with that value in it.

So, I have to use criteria that combines the 2 methods, something like:

Like Forms!frmFilterPublications! & "*"

which, of course, does not work. Can anybody help?

thanks

Dave
 
If you use a combo box for your titles, the user will only need to start to type in the name for valid values to be presented. So if you type W you list would zoom to Wild Animals, Wine Buyer, Woodworker. By the time you've typed WIN you just have to hit enter for Wine Buyer.

Does this help?
 
Query by form

thanks for your kind reply Neil,

the problem is that the value that the users enter in the search form can be anywhere in the title and not just at the beginning. So, if a user enters "tariff" that string can appear:

tariffxxxxxxx
xxxxtariffxxxx
xxxxxxtariff

What I am looking for is a filter that selects those records that contains a specific string anywhere in the title. The following criteria should work for those records that contain that string at the beginning of the title:

Like forms!FormName!FieldName & "*"

I know it should because I have seen examples of it in the Microsoft Database. But it doesn't! If it would then it would reasonable to expect something like:

Like "*" & forms!FormName!FieldName & "*"

or not? What do you think?

thanks

Dave
 
Exactly right. You need the * at each end if you want to match anywhere in the string.
 

Users who are viewing this thread

Back
Top Bottom