Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo lookup of characters anywhere in the name 3

Status
Not open for further replies.

molly

Technical User
Jul 17, 2000
219
US
I have a form with a combo box used to lookup a Formula Name.

The below works. However, it is rigid and precise. EG if I type Black, then i get all formula names that begin with black.

But i want Black anywhere within the formulaname. EG Black pepper or maybe Pepper ground Black. I would want to see both name to pick from. How can i improve the below After Update?

Private Sub CboFormulaNameFilter_AfterUpdate()

DoCmd.ApplyFilter , _
"[Description] = Forms![frmPriceSpecificMain]![cboFormulaNameFilter]"
Me.CboFormulaNameFilter = Null

End Sub


thanks
 
Ginger - tried what you said and i get the same result which is, i get only records starting with the word BEEF BASE. I did a simple *beef* query and see that there are 87 descriptions with the word Beef in it. Below is just a 14 sample for space reasons. Only the records with Beef Base showed up in the combo box.

ProductID Description
700182 AUJUS BEEF GRAVY
700317 BEEF BASE (Granules) (1 lb Bulk)
700318 BEEF BASE (Granules) (25 lb Bulk)
700319 BEEF BASE (Granules) (5 lb Bulk)
700321 BEEF BASE (Granules) (120 oz)
700322 BEEF BASE (Granules) (40 lbs)
700323 BEEF BASE (Granules) (28 oz)
700324 BEEF BROTH POWDER, SUPERIOR
700938 COLD MIX BEEF GRAVY
701003 CORNED BEEF - KOSHER
701544 HONEY TERIYAKI NAT BEEF STK (Bulk)
702439 PICKLING SPICE, CORNED BEEF
702476 PIZZA BEEF ITALIAN SEASONING (50 LBS)
702610 RED Tiger MEXI-BEEF SEASONING (25 X 16 OZ.)*
plus 73 more records with BEEF in the description

molly
 
Ginger - i just noticed something. There are really only 28 records of the 87 that have a PriceType=92. I misinformed you. so i should see 28 records.

But this is even more interesting. Remember i said that Beef Base only shows up? Well, Beef Base is a priceType=77.
It should have never shown up since we asked only for PriceType=92.

So something is coded wrong in the On Change Event where i only want PriceType=92.

Maybe this fix will then fix the whole deal up for me?
Molly
 
Ginger - PriceTypeID is a number field, single, in my tblProduct. Just in case this matters.
molly
 
Ginger - you are right. it all works. I made a stripped down version and embedded your code.

So i will spend my own time figuring out what i have wrong in my real model.

You did a great job.

Molly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top