make filter off multiple entries

Cameroncha

Registered User.
Local time
Today, 23:13
Joined
Jul 1, 2002
Messages
58
I would like to make a "filter" to generate a table / query / or a form that contains values from multiple space or comma delimited entries.

any input / ideas on how to make this "filter" the simpler the better /

The values of my filter would be SKU

so i would copy a series of cells from excel in looking like this.
"sk600 sk555 sk452 vl325"

and would like to produce a table with these sku's


thank you
 
Possible Solution:

Have a Text Box for entering the SKU numbers.

Create the Where part of the SQL using the following:

Dim arSKU As Variant
Dim stReturn as String
'Split the SKU list into an Array
arSKU = Split(Me.txtSKU, " ")
'Join them back together in the "WHERE" form
stReturn = Join(arSKU, "' OR [SKU]='")
stReturn = "[SKU]='" & Me.txtReturn & "'"


Using the Split function will turn the SKU list into a single dimensional Array and then using the Join Function you put the strings back together using the "' OR [SKU]='" as the new deliminator.

An other possible method would be to use the Replace function. This would allow you to replace the diliminating Character with "' OR [SKU]='" and skip the array.
 

Users who are viewing this thread

Back
Top Bottom