Auto-fill in based on PART of another text box

I

ILoveAccess

I currently use Access 97, but will be upgrading to 2003 within a couple of
months.

I have 1,000's of different types of models. EXAMPLE: Model series 2660 is
part of the product family (WOB-L) It can look like 2660CE35, 2660ca12/46-12
or MANY other combinations. Also model series SR part of the product family
LIQUID; it can look like SR10, SR12, SR-143, or MANY other combinations.

On my Form called "frmHistory", I would like to auto-fill my combo box
called "Product" based on a what model# I enter in the text box called
"Model". ("Product" is bound to the table called "tblProducts".) But, how do
I do this when there are so many model combinations?

I am a novice at vba, so please be detailed in your instructions. Thank you
sooo much in advance!
 
K

Ken Snell [MVP]

Assuming that the "product numbers" always start with the model, you could
use a query for the combo box's Row Source -- this type of query will return
all products that begin with whatever you have typed in the textbox Model:

SELECT [Product] FROM tblProducts WHERE [Product] Like [Model] & "*";

Then run simple code similar to this on the AfterUpdate event of the textbox
Model (this code will requery the Row Source query to fill the combo box's
list based on what you've typed into the textbox):

Private Sub Model_AfterUpdate()
Me!Product.Requery
End If
 
Top