What is [XXXXX]? A little less cryptic please.
Main Topics
Browse All TopicsHello!
I have a query by form function that calls a report. The form is pretty straightforward...about a dozen drop-downs with static possibilities. The form is connected to a query that uses the following formula to handle all the query possibilities:
IIf(IsNull([Forms]
Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
shambalad: Thank you for the quick reply. The formula references two items: the combobox from the form I am using to select my search parameter, and within the query itself. Confusingly, they have the same name (Notes). A better way would be to have them labeled differently (frmSearchNotes and qryNotes, perhaps). Regardless, basically the IIF is saying that if the "Notes" field in the search form is empty, then default to the "Notes" field from the query (which will include every possible record). Otherwise, choose the "Notes" field from the Search form (which will filter for that term). This is how it works for all the other fields on the search form, anyway (I have about a dozen). However, I would like to search the entire paragraph of the "Notes" field by a single word and if that word is contained in the field (anywhere), I would like it reflected in my report. Also, I need it to be an IIF funtion to account for when there is nothing entered in the "Notes" field on the search form. This is what I've come up with below, but it does not work:
IIf(IsNull([Forms]![frmSea
Thank again for the help, it's very much appreciated. I'm open to other methods of doing this, but need those two elements: accounting for null values, and partial text search.
GRayL: XXXXX was basically a variable. In actuality, it reflected whatever field I was searching on ("Name," "Address," "Notes," etc). What I originally posted works for all my values if there is only one possibility ("John" or "Jim" or "Kevin"), but I need to be able to search for just part of an entry (as would be the case with a key word in the Notes field). Hope that helps.
GRayL: You answered another very similar question with the below response. This is very close to what I am looking for. How to I work this into an IIF statement???
"GRayL:I imagine you are using this in a query somewhere, so the WHERE clause has to be:
WHERE Customer Like "*" & [Forms]![SearchCustomer]![
My SQL statement reads:
WHERE ((tblMaster.Notes)=IIf(IsN
What is wrong with this?
Business Accounts
Answer for Membership
by: shambaladPosted on 2009-05-06 at 13:16:23ID: 24319177
In the above formula, do the [XXXXX]'s all refer to the same control? That is to say, if you have a combo box names 'cboName', would the above formula be:
rch]![cboN ame]),[cbo Name],[For ms]![frmSe arch]![cbo Name])
IIf(IsNull([Forms]![frmSea
Would it be possible to see the whole query?
A lot depends on how many records you are processing. Using a wild card search on a larger text field can be very time-consuming. There are some alternate ways to do that kind of a search in a query (e.g. you can write your own function and use it in a query).
Todd