Search box to filter subform records, using LIKE criteria

C

CSOUSA

Hi!

I am trying to make a text-box search on a Main Form that will filter the
Subform Records (which are displayed from a PRODUCT/TECH ISSUES Query). They
would be filtered using Product Number. The full product number is about 9
characters, but it would be ideal for the user to be able to enter only the
first 3 characters (indicating the product family) or the first 7 characters
(for family + version) and find ALL query records relating to the entire
family, family +version, etc. This way they can see all TECH ISSUES for the
whole family or version, not just a specific revision.

For example, there may be a product ABC1234-XY-Z1 and a product
ABC1234-YZ-A2, but I want to see ALL query tech issues for products starting
in ABC or ABC1234 or ABC1*, etc. (Whichever the user decides to enter.)

I am generally skilled in access but only mildy familiar with VB. What
would be the best way to do this?

Thanks and all the best...
 
P

Piet Linden

Hi!

I am trying to make a text-box search on a Main Form that will filter the
Subform Records (which are displayed from a PRODUCT/TECH ISSUES Query).  They
would be filtered using Product Number.  The full product number is about 9
characters, but it would be ideal for the user to be able to enter only the
first 3 characters (indicating the product family) or the first 7 characters
(for family + version) and find ALL query records relating to the entire
family, family +version, etc.  This way they can see all TECH ISSUES for the
whole family or version, not just a specific revision.

For example, there may be a product ABC1234-XY-Z1 and a product
ABC1234-YZ-A2, but I want to see ALL query tech issues for products starting
in ABC or ABC1234 or ABC1*, etc. (Whichever the user decides to enter.)

I am generally skilled in access but only mildy familiar with VB.  What
would be the best way to do this?

Thanks and all the best...

SELECT ...
FROM MyTable
WHERE MyField LIKE [Enter A string:] & "*"
 
C

CSOUSA

Piet Linden said:
Hi!

I am trying to make a text-box search on a Main Form that will filter the
Subform Records (which are displayed from a PRODUCT/TECH ISSUES Query). They
would be filtered using Product Number. The full product number is about 9
characters, but it would be ideal for the user to be able to enter only the
first 3 characters (indicating the product family) or the first 7 characters
(for family + version) and find ALL query records relating to the entire
family, family +version, etc. This way they can see all TECH ISSUES for the
whole family or version, not just a specific revision.

For example, there may be a product ABC1234-XY-Z1 and a product
ABC1234-YZ-A2, but I want to see ALL query tech issues for products starting
in ABC or ABC1234 or ABC1*, etc. (Whichever the user decides to enter.)

I am generally skilled in access but only mildy familiar with VB. What
would be the best way to do this?

Thanks and all the best...

SELECT ...
FROM MyTable
WHERE MyField LIKE [Enter A string:] & "*"

Thanks, how genius, of course it worked!

And much easier than linking it to a text box on a form, while yielding the
same results. Now I have a macro to filter by this query OnOpen and it
brings up the prompt just fine.

: )
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top